I'm trying to write a new .rules
file for PolicyKit. My test attempt (in the directory /etc/polkit-1/rules.d/
) looks like this:
polkit.addRule(function(action, subject) {
polkit.spawn(["rm","/home/gabriel/test"]);
if (action.id == "org.freedesktop.policykit.exec") {
polkit.log("action=" + action);
polkit.log("subject=" + subject);
}
return polkit.Result.NOT_HANDLED;
});
But as far as I can tell, this code is never run. The test
file is still there, and there's no log output after running something like $ pkexec -u otheruser bash
(I have tried marking the .rules
files as executable.)