View previous topic :: View next topic |
Author |
Message |
bell Guru


Joined: 27 Nov 2007 Posts: 518
|
Posted: Fri Jun 27, 2025 7:12 am Post subject: [SOLVED] XFCE setting backlight value requires root password |
|
|
Since some system updates ago I am asked for root password because my xfce try to call "xfpm-power-backlight-helper --set-brightness 0" with action details "org.freedesktop.policykit.exec" each boot, or if I try to change brightness using XFCE panel plugin.
I get the same result if I call Code: | pkexec xfpm-power-backlight-helper --set-brightness 0 | in command line.
Looking in emerge logs the sys-auth/polkit-126-r1 and xfce-base/xfce4-power-manager-4.20.0 is not updated last time, so that should not be the issue.
Basically I do not need the root permissions! The "/sys/devices/pci0000:00/0000:00:08.1/0000:04:00.0/drm/card0/card0-eDP-1/amdgpu_bl0/brightness" is writteable by group "video" and my user is in this group.
does the job without any issues for my user.
What could be the issue for missed permission and how I can solve it?
Why XFCE try to set the brightness to 0 (Get screen black)?
Last edited by bell on Sat Jun 28, 2025 3:49 pm; edited 1 time in total |
|
Back to top |
|
 |
WARP7 n00b

Joined: 27 Jun 2025 Posts: 1 Location: France
|
Posted: Fri Jun 27, 2025 4:34 pm Post subject: |
|
|
same problem here |
|
Back to top |
|
 |
pimiento n00b

Joined: 09 Dec 2017 Posts: 27
|
Posted: Fri Jun 27, 2025 6:59 pm Post subject: |
|
|
I got the same problem when I updated mate-power-manager. It asks root password for set-brightness option. Here are use flags for my mate-power-manager:
Code: | ~ equery u mate-power-manager
[ Legend : U - final flag setting for installation]
[ : I - package is installed with flag ]
[ Colors : set, unset ]
* Found these USE flags for mate-extra/mate-power-manager-1.28.1-r1:
U I
+ + applet : Enable building of the MATE applet.
+ + elogind : Enable session tracking via sys-auth/elogind
+ + keyring : Enable support for freedesktop.org Secret Service API password store
+ + policykit : Enable PolicyKit (polkit) authentication support
- - systemd : Enable use of systemd-specific libraries and features like socket activation or session tracking
- - test : Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently) |
|
|
Back to top |
|
 |
Josef.95 Advocate

Joined: 03 Sep 2007 Posts: 4833 Location: Germany
|
|
Back to top |
|
 |
bell Guru


Joined: 27 Nov 2007 Posts: 518
|
Posted: Sat Jun 28, 2025 3:49 pm Post subject: |
|
|
Thank you, Josef.95!
It is the bug. I modified the /usr/share/polkit-1/actions/org.xfce.power.policy replacing both the "/usr/sbin" paths by "/usr/bin". Now the issue is away.
By the way I did a grep for sbin in /usr/share/polkit-1 folder and adjusted /usr/share/polkit-1/actions/org.gsmartcontrol.policy too. Now the gsmarcontrol launch without asking for root password too. |
|
Back to top |
|
 |
sublogic Guru


Joined: 21 Mar 2022 Posts: 349 Location: Pennsylvania, USA
|
Posted: Sat Jun 28, 2025 11:48 pm Post subject: |
|
|
Same here, on a merged-/usr profile. As a best practice, I copied to and edited /etc/polkit-1/actions/org.xfce.power.policy rather than editing the file under /usr/share , so the change survives the next update.
(Of course the next update will probably fix the bug, but you know, best practice.) |
|
Back to top |
|
 |
kozel n00b


Joined: 05 Nov 2022 Posts: 3
|
Posted: Sun Jun 29, 2025 6:16 am Post subject: |
|
|
Quote: | Looking in emerge logs the sys-auth/polkit-126-r1 and xfce-base/xfce4-power-manager-4.20.0 is not updated last time, so that should not be the issue. |
sys-auth/polkit-126-r1 was stabilized for amd64 on June 21, and that was the moment after which I got the same problem.
Thank you for this topic My "temporary fix" was to disable "policykit" USE flag for xfce4-power-manager, but I doubt it was the best option. |
|
Back to top |
|
 |
Massimo B. Veteran


Joined: 09 Feb 2005 Posts: 1907 Location: PB, Germany
|
Posted: Tue Jul 01, 2025 7:02 am Post subject: |
|
|
sublogic wrote: | Same here, on a merged-/usr profile. As a best practice, I copied to and edited /etc/polkit-1/actions/org.xfce.power.policy rather than editing the file under /usr/share , so the change survives the next update. |
Hm, that didn't solve it for me. I also made a custom copy and modified that: Code: | diff -U0 /usr/share/polkit-1/actions/org.xfce.power.policy /etc/polkit-1/actions/org.xfce.power.policy
--- /usr/share/polkit-1/actions/org.xfce.power.policy 2025-03-20 06:56:27.914142928 +0100
+++ /etc/polkit-1/actions/org.xfce.power.policy 2025-07-01 08:49:45.239588061 +0200
@@ -0,0 +1,4 @@
+<!--
+WORKAROUND. Please remove this file with version greater than sys-auth/polkit-126-r1
+-->
+
@@ -93 +97 @@
- <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/xfpm-power-backlight-helper</annotate>
+ <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/xfpm-power-backlight-helper</annotate>
@@ -175 +179 @@
- <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/xfce4-pm-helper</annotate>
+ <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/xfce4-pm-helper</annotate> | Then I rebooted. But on display brightness changes in Xfce I still get the failure message from xfpm-power-backlight-helper to authenticate. _________________ HP ZBook Power G9 i7-12700H|HP ProDesk 600 G5 i7-9700|HP EliteDesk 800 G1 i7-4790|HP Compaq Pro 6300 i7-3770 |
|
Back to top |
|
 |
Massimo B. Veteran


Joined: 09 Feb 2005 Posts: 1907 Location: PB, Germany
|
Posted: Tue Jul 01, 2025 9:26 am Post subject: |
|
|
In the syslog I find: Code: | # grep polkit /var/log/everything/current
Jul 01 10:46:21 [polkitd] Registered Authentication Agent for unix-session:3 (system bus name :1.50 [/usr/libexec/polkit-gnome-authentication-agent-1], object path /org/gnome/PolicyKit1/AuthenticationAgent, locale de_DE.UTF-8)
Jul 01 10:47:43 [polkitd] Operator of unix-session:3 FAILED to authenticate to gain authorization for action org.freedesktop.policykit.exec for unix-process:4953:7779 [xfce4-power-manager] (owned by unix-user:mb) |
Code: | # equery belongs xfpm-power-backlight-helper
* Searching for xfpm-power-backlight-helper ...
xfce-base/xfce4-power-manager-4.20.0 (/usr/sbin/xfpm-power-backlight-helper) |
Code: | # ls -al /usr/sbin/xfpm-power-backlight-helper
-rwxr-xr-x 1 root root 15K 20. Mär 06:56 /usr/sbin/xfpm-power-backlight-helper*
|
Code: | # eselect profile show
Current /etc/portage/make.profile symlink:
default/linux/amd64/23.0/desktop | I'm using OpenRC. Code: | # realpath /usr/sbin/xfpm-power-backlight-helper
/usr/bin/xfpm-power-backlight-helper |
_________________ HP ZBook Power G9 i7-12700H|HP ProDesk 600 G5 i7-9700|HP EliteDesk 800 G1 i7-4790|HP Compaq Pro 6300 i7-3770 |
|
Back to top |
|
 |
sublogic Guru


Joined: 21 Mar 2022 Posts: 349 Location: Pennsylvania, USA
|
Posted: Tue Jul 01, 2025 11:14 pm Post subject: |
|
|
Massimo, that is strange. Does it work if you edit the /usr/share copy ?
On my setup, Code: | $ diff -U0 {/usr/share,/etc}/polkit-1/actions/org.xfce.power.policy
--- /usr/share/polkit-1/actions/org.xfce.power.policy 2025-02-01 08:38:29.780040607 -0500
+++ /etc/polkit-1/actions/org.xfce.power.policy 2025-06-28 19:33:30.553314849 -0400
@@ -93 +93 @@
- <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/xfpm-power-backlight-helper</annotate>
+ <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/xfpm-power-backlight-helper</annotate>
@@ -175 +175 @@
- <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/xfce4-pm-helper</annotate>
+ <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/xfce4-pm-helper</annotate> |
I got log errors too, in auth.log, now gone. Code: | Jun 28 19:36:28 localhost polkitd[3186]: Operator of unix-session:1 FAILED to authenticate to gain authorization for action org.freedesktop.policykit.exec for unix-process:3340:5358 [xfce4-power-manager] (owned by unix-user:pa)
Jun 28 19:36:34 localhost polkitd[3186]: Registered Authentication Agent for unix-session:2 (system bus name :1.56 [/usr/libexec/polkit-gnome-authentication-agent-1], object path /org/gnome/PolicyKit1/AuthenticationAgent, locale en_US.utf8)
Jun 28 19:36:37 localhost polkitd[3186]: Operator of unix-session:2 FAILED to authenticate to gain authorization for action org.freedesktop.policykit.exec for unix-process:5420:90250 [xfce4-power-manager] (owned by unix-user:pa)
Jun 28 19:36:51 localhost polkitd[3186]: Unregistered Authentication Agent for unix-session:2 (system bus name :1.56, object path /org/gnome/PolicyKit1/AuthenticationAgent, locale en_US.utf8) (disconnected from bus)
Jun 28 19:36:51 localhost polkitd[3186]: Operator of unix-session:2 FAILED to authenticate to gain authorization for action org.freedesktop.policykit.exec for unix-process:5420:90250 [xfce4-power-manager] (owned by unix-user:pa) |
|
|
Back to top |
|
 |
sublogic Guru


Joined: 21 Mar 2022 Posts: 349 Location: Pennsylvania, USA
|
Posted: Sun Jul 06, 2025 12:25 am Post subject: |
|
|
AAACK ! It's prompting me for the root password again !
This is after a reboot (because glibc was upgraded).
I noticed that the polkit-1/actions/ directory under /etc was root:root rwxr-x--- while the original under /usr/share was root:root rwxr-xr-x .
I changed the permissions to rwxr-xr-x, logged out, logged back in, and now I can change the brightness without being asked for root.
The root umask is 022, the /etc/polkit-1/actions must have been created as rwxr-xr-x because I didn't do anything special. What changed the permission? The reboot? How?
@Massimo: I didn't try to answer my own question (modifying the /usr/share copy) because, well, it works again. _________________ The practical unit of "Learning Experience" is the milli-Gentoo. |
|
Back to top |
|
 |
grknight Retired Dev

Joined: 20 Feb 2015 Posts: 2241
|
Posted: Wed Jul 09, 2025 12:48 pm Post subject: |
|
|
sublogic wrote: | The root umask is 022, the /etc/polkit-1/actions must have been created as rwxr-xr-x because I didn't do anything special. What changed the permission? The reboot? How? |
Check if any setting for tmpfiles.d (like in /etc/tmpfiles.d and /usr/lib/tmpfiles.d) is resetting the permissions. Some packages may (ab)use this for more than just "tmpfiles". |
|
Back to top |
|
 |
sublogic Guru


Joined: 21 Mar 2022 Posts: 349 Location: Pennsylvania, USA
|
Posted: Thu Jul 10, 2025 1:25 am Post subject: |
|
|
grknight wrote: | Check if any setting for tmpfiles.d (like in /etc/tmpfiles.d and /usr/lib/tmpfiles.d) is resetting the permissions. Some packages may (ab)use this for more than just "tmpfiles". |
I thought about that. There is no /etc/tmpfiles.d ; there is /usr/lib/tmpfiles.d/polkit-tmpfiles.conf, owned by sys-auth/polkit , to create /etc/polkit-1/rules.d , owned root:polkitd , permissions 0750 , but nothing about /etc/polkit-1/actions .
(I don't reboot often, it's a lapotp; I suspend to RAM or (rarely) hibernate.)
EDIT: Okay, I rebooted. Permissions are fine and the backlight adjustment works without authentication. _________________ The practical unit of "Learning Experience" is the milli-Gentoo. |
|
Back to top |
|
 |
|