mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-08-08 22:27:48 +02:00
Scope polkit actions to require the privileged group
This commit is contained in:

committed by
afayaz-feral

parent
898ab01924
commit
337f1b8a8e
@@ -18,7 +18,7 @@
|
||||
<defaults>
|
||||
<allow_any>no</allow_any>
|
||||
<allow_inactive>no</allow_inactive>
|
||||
<allow_active>yes</allow_active>
|
||||
<allow_active>no</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">@LIBEXECDIR@/cpugovctl</annotate>
|
||||
</action>
|
||||
@@ -29,7 +29,7 @@
|
||||
<defaults>
|
||||
<allow_any>no</allow_any>
|
||||
<allow_inactive>no</allow_inactive>
|
||||
<allow_active>yes</allow_active>
|
||||
<allow_active>no</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">@LIBEXECDIR@/gpuclockctl</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
|
12
data/polkit/rules.d/gamemode.rules.in
Normal file
12
data/polkit/rules.d/gamemode.rules.in
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Allow users in privileged gamemode group to run cpugovctl &
|
||||
* gpuclockctl without authentication
|
||||
*/
|
||||
polkit.addRule(function (action, subject) {
|
||||
if ((action.id == "com.feralinteractive.GameMode.governor-helper" ||
|
||||
action.id == "com.feralinteractive.GameMode.gpu-helper") &&
|
||||
subject.isInGroup("@GAMEMODE_PRIVILEGED_GROUP@"))
|
||||
{
|
||||
return polkit.Result.YES;
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user