Skip to content

Commit

Permalink
liveinst: Ensure DBUS_SESSION_BUS_ADDRESS is set in live install
Browse files Browse the repository at this point in the history
Since commit 919be1d anaconda has
been using pkexec instead of consolehelper to get root privileges
on the live image.

pkexec more thoroughly cleans the environment before elevating
privileges than consolehelper so DBUS_SESSION_BUS_ADDRESS gets
expunged.

Anaconda needs that variable to disable the screensaver (and
for other reasons).

This commit ensures it gets set explicitly after privileges have
been raised.
  • Loading branch information
halfline committed Aug 22, 2023
1 parent a260c76 commit 81b53cd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data/liveinst/liveinst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ if [ "$(id -u)" -ne 0 ]; then
exec 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
fi

# Allow running another command in the place of anaconda, but in this same
# environment. This allows storage testing to make use of all the module
# loading and lvm control in this file, too.
Expand Down

0 comments on commit 81b53cd

Please sign in to comment.