How to get org.mate.CPUFreqSelector polkit access working for specified user group?

Could someone help me out and direct me on how to get polkit access as group member to org.mate.cpufreqselector (addon cpufreq in mate-panel)? I been trying to get it to work and I am missing something.....

Would someone be so kind to help me out? If you change the ipausers to sudo or wheel it should work on most systems I think.

/usr/share/polkit-1/rules.d/org.mate.CPUFreqSelector.rules

polkit.addRule(function(action, subject) {
    if (action.id == "org.mate.cpufreqselector" &&
        subject.isInGroup("ipausers")) {
        return polkit.Result.YES;
    }
});

I also tried:

/etc/dbus-1/system.d/org.mate.CPUFreqSelector.conf

<!DOCTYPE busconfig PUBLIC
 "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
  <policy group="ipausers">
    <allow own="org.mate.cpufreqselector"/>
    <allow send_destination="org.mate.cpufreqselector"/>
    <allow receive_sender="org.mate.cpufreqselector"/>
  </policy>
</busconfig>

Hi @jelledj :slight_smile:

Do you mean this ?

Peek 2020-12-09 20-57

Yes, but then as normal user without having to provide root access, so with polkit authentication. How do I create the policy or rules that a group has authentication to the org.mate.cpufreqselector?

It have to work without any password be default (in my case it is not asking password).

If you just want to change it without input any password, maybe just apt-reconfigure the package will help ?

Here is the content of my /usr/share/polkit-1/actions/org.mate.cpufreqselector.policy

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
          "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
          "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
<policyconfig>

  <vendor>The MATE Project</vendor>
  <vendor_url>http://www.mate-desktop.org</vendor_url>
  <icon_name>mate-cpu-frequency-applet</icon_name>

  <action id="org.mate.cpufreqselector">
    <description>Change CPU Frequency scaling</description>
    <message>Privileges are required to change the CPU Frequency scaling.</message>
    <defaults>
      <allow_inactive>no</allow_inactive>
      <allow_active>auth_admin_keep</allow_active>
    </defaults>
  </action>

</policyconfig>

Maybe to set this 2 lines like this and restart polkit or reboot :

<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>

I solved it by:

/var/lib/polkit-1/localauthority/50-local.d/org.mate.cpufreqselector.pkla

[org.mate.cpufreqselector]
Identity=unix-user:*
Action=org.mate.cpufreqselector
ResultActive=yes
1 Like