Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

liveinst: bubble more user env variables through anaconda to the webui #5397

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions data/liveinst/liveinst
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@
# unprivileged, restart running as root.
if [ "$(id -u)" -ne 0 ]; then
xhost +si:localuser:root
unset XAUTHORITY
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be sure, all these changes work also on non-WebUI Live media, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still need to test all, Web UI and others - moved the PR to Draft to clarify this is a work in progress.

It's more like fresh version of #5058 so that I can generate some images and test, as I can't do it locally.

pkexec "$0" "$@"
fi

# pkexec clears DBUS_SESSION_BUS_ADDRESS from environment
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${PKEXEC_UID}/bus

# pkexec clears the environment, so get it back
if [ -n "${PKEXEC_UID}" ]; then
INSTALLER_USER=$(id -n -u "${PKEXEC_UID}")
readarray -t user_environment < <(pkexec --user "${INSTALLER_USER}" env XDG_RUNTIME_DIR="/run/user/${PKEXEC_UID}" systemctl --user show-environment)

for variable in "${user_environment[@]}"; do
export "$variable"

Check warning

Code scanning / shellcheck

This does not export 'variable'. Remove $/${} for that, or use ${var?} to quiet. Warning

This does not export 'variable'. Remove $/${} for that, or use ${var?} to quiet.
done
fi

# Allow running another command in the place of anaconda, but in this same
Expand Down
Loading