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

screensaver: Look at $PKEXEC_UID not $USERHELPER_UID #5068

Merged
merged 2 commits into from
Aug 22, 2023

Conversation

halfline
Copy link
Contributor

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.

@github-actions github-actions bot added the f39 label Aug 22, 2023
@jkonecny12
Copy link
Member

/kickstart-test --testtype smoke

@VladimirSlavik
Copy link
Contributor

What's the effect on boot.iso?

@M4rtinK
Copy link
Contributor

M4rtinK commented Aug 22, 2023

What's the effect on boot.iso?

According to @jkonecny12 this is not used on boot.iso, so hopefully it should not break it.

@M4rtinK
Copy link
Contributor

M4rtinK commented Aug 22, 2023

/boot-iso --webui

@jkonecny12
Copy link
Member

/kickstart-test --testtype smoke

@jkonecny12
Copy link
Member

jkonecny12 commented Aug 22, 2023

What's the effect on boot.iso?

The inhibit call is done here https://github.com/rhinstaller/anaconda/blob/master/pyanaconda/startup_utils.py#L358

def live_startup():
    """Live environment startup tasks."""
    inhibit_screensaver()

From my grep call of the code this is the only call of this function so it should be pretty safe.

Copy link
Member

@jkonecny12 jkonecny12 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks!

@@ -63,15 +63,15 @@
class SetEuidFromConsolehelper():
Copy link
Member

Choose a reason for hiding this comment

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

We should ideally also rename this class but that could be done as follow up.

@M4rtinK
Copy link
Contributor

M4rtinK commented Aug 22, 2023

From my grep call of the code this is the only call of this function so it should be pretty safe.

ACK, thanks for checking! :)

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.
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.
Copy link
Contributor

@M4rtinK M4rtinK left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for looking into this! :)

@jkonecny12
Copy link
Member

/kickstart-test --testtype smoke

Copy link
Member

@jkonecny12 jkonecny12 left a comment

Choose a reason for hiding this comment

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

Even better now.

Comment on lines +29 to +32
# 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
Copy link
Member

Choose a reason for hiding this comment

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

I wonder how many of these issues could impact us. Anyway, let's go one by one :)

@M4rtinK
Copy link
Contributor

M4rtinK commented Aug 22, 2023

/boot-iso --webui

@github-actions
Copy link

boot.iso built successfully based on commit 5aa92b6. Download it from the bottom of the job status page.

@github-actions
Copy link

boot.iso built successfully based on commit 81b53cd. Download it from the bottom of the job status page.

@M4rtinK M4rtinK merged commit 6ae12cd into rhinstaller:master Aug 22, 2023
18 checks passed
@AdamWill
Copy link
Contributor

@kparal suggested to also check whether inhibition of suspend is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

6 participants