Skip to content

Commit

Permalink
screensaver: Look at $PKEXEC_UID not $USERHELPER_UID
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.

This caused a regression on the KDE live image, because anaconda
was trying to inhibit the screensaver as the $USERHELPER_UID user
which no longer gets set.

This commit changes the code to use $PKEXEC_UID which is the polkit
equivalent.
  • Loading branch information
halfline committed Aug 22, 2023
1 parent aa741a5 commit 212085d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyanaconda/screensaver.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@
class SetEuidFromConsolehelper():
"""Context manager to temporarily set euid from env. variable set by consolehelper.
Live installs use consolehelper to run as root, which sets the original UID in $USERHELPER_UID.
Live installs use pkexec to run as root, which sets the original UID in $PKEXEC_UID.
"""
def __init__(self):
self.old_euid = None

def __enter__(self):
if "USERHELPER_UID" in os.environ:
if "PKEXEC_UID" in os.environ:
self.old_euid = os.geteuid()
new_euid = int(os.environ["USERHELPER_UID"])
new_euid = int(os.environ["PKEXEC_UID"])
os.seteuid(new_euid)
return self

Expand Down

0 comments on commit 212085d

Please sign in to comment.