Subject: bug#48265: closed (Re: bug#48265: Authentication is needed to run mate-power-backlight-helper)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 29 Jun 2025 01:00:07 +0000

Your bug report

#48265: mate-power-backlight-helper is referred to by store name instead of polkit action (IIUC)

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
48265: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48265
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#48265: Authentication is needed to run mate-power-backlight-helper
From: 宋文武 <[email-masked]>
To: Christopher League <[email-masked]>
Cc: [email-masked]
Date: Sun, 29 Jun 2025 09:05:15 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Christopher League <[email-masked]> writes:

> Hi, after a recent update, I am having the same authentication
> issue with the brightness helper on the Mate desktop:
>
>> Authentication is needed to run
>> /gnu/store/ra8zy...-mate-power-manager-1.28.1/sbin/
>> mate-power-backlight-helper as the super user.
>
> As noted previously on this bug report, the polkit
> org.mate.power.policy file refers to an absolute store path.
>
> But I think ultimately the problem may have to do with the fact that
> mate-power-manager APPEARS TWICE in the system closure:
>
> $ guix gc -R /gnu/store/2zf16...-system | grep mate-power
> /gnu/store/ra8zy...-mate-power-manager-1.28.1
> /gnu/store/a14gf...-mate-power-manager-1.28.1

Hello, this should be fixed with commit b7a8f886f50. Close, thanks.

Subject: mate-power-backlight-helper is referred to by store name instead of polkit action (IIUC)
From: Maxime Devos <[email-masked]>
To: [email-masked]
Date: Thu, 06 May 2021 22:24:43 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Related to: https://issues.guix.gnu.org/22952

On a mate desktop (mate-desktop-service-type).

FN-F9, FN-F10 (binded to ‘decrease brightness’ and ‘increase brightness’):

> Authentication is needed to run '/gnu/store/mp33h4vqdw0scdkjj0v6c3gima9wz8lm-mate-power-manager-1.24.2/sbin/mate-power-backlight-helper' as the super user.

Contents of /etc/polkit-1/actions/org.mate.power.policy:

  [...]
  <icon_name>battery</icon_name>
  <action id="org.mate.power.backlight-helper">
    <!-- SECURITY:
          - A normal active user on the local machine does not need permission
            to change the backlight brightness.
     -->
    <description>Modify the laptop brightness</description>
    <message>Authentication is required to modify the laptop brightness</message>
    <defaults>
      <allow_any>no</allow_any>
      <allow_inactive>no</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.exec.path">/gnu/store/zk4kb4437032swahywmgyzn55b5w5wj8-mate-power-manager-1.24.2/sbin/mate-power-backlight-help>
  </action>
  [...]

FWIW, the following works as expected (no error message), using the store path in .policy:
$ pkexec /gnu/store/zk4kb4437032swahywmgyzn55b5w5wj8-mate-power-manager-1.24.2/sbin/mate-power-backlight-helper --set-brightness=300
Maybe MATE is trying the equivalent of "pkexec /wrong/store/path/mate-power-backlight-helper --etcetera" instead
of referring to the action by name org.mate.power.backlight-helper.

Note the store path is different. Now try something different

$ which mate-power-backlight-helper
> /run/current-system/profile/sbin/mate-power-backlight-helper
$ ls -l /run/current-system/profile/sbin/mate-power-backlight-helper
> /gnu/store/ffqhy4xdpzkg06rlq76zrbwn8v3rqgw9-mate-1.24.1/sbin/mate-power-backlight-helper

Now we have three different store paths so far!

Not sure what the proper way to resolve this, and what causes the three different store paths,
but one way to resolve this would be referring to /run/current-system/profile/sbin/mate-power-backlight-helper
in org.mate.power.policy (untested!).

It looks like there could very well be be similar issues in (unverified):

* /etc/polkit-1/actions/org.gnome.controlcenter.remote-login-helper.policy
* /etc/polkit-1/actions/org.gnome.gnome-system-monitor.policy
* /etc/polkit-1/actions/org.gnome.settings-daemon.plugins.power.policy
* /etc/polkit-1/actions/org.gnome.settings-daemon.plugins.wacom.policy
* grep for /gnu/store/ in /etc/polkit-1/actions/*.policy

Greetings,
Maxime.