I have a workstation (running Arch Linux) which shows the following messages in the journal.
Jul 30 14:33:59 workstation polkitd[571]: Acquired the name org.freedesktop.PolicyKit1 on the system bus
Jul 30 14:33:59 workstation systemd[1]: Started Authorization Manager.
Jul 30 14:33:59 workstation dbus-daemon[456]: [system] Successfully activated service 'org.freedesktop.PolicyKit1'
Jul 30 14:33:59 workstation polkitd[571]: Finished loading, compiling and executing 2 rules
Jul 30 14:33:59 workstation polkitd[571]: Error compiling script /etc/polkit-1/rules.d/40-allow-passwordless-printer-admin.rules
Jul 30 14:33:59 workstation polkitd[571]: Loading rules from directory /usr/share/polkit-1/rules.d
Jul 30 14:33:59 workstation polkitd[571]: Loading rules from directory /etc/polkit-1/rules.d
Jul 30 14:33:59 workstation polkitd[571]: Started polkitd version 0.114
Jul 30 14:33:59 workstation nm-dispatcher[544]: req:2 'connectivity-change': start running ordered scripts...
Jul 30 14:33:59 workstation nm-dispatcher[544]: req:2 'connectivity-change': new request (1 scripts)
Jul 30 14:33:59 workstation systemd[1]: Starting Authorization Manager...
Jul 30 14:33:59 workstation dbus-daemon[456]: [system] Activating via systemd: service name='org.freedesktop.PolicyKit1' unit='polkit.service' requested by ':1.1' (uid=0 pid=457>
The contents of the file are:
polkit.addRule(function(action, subject) {
if (action.id == "org.opensuse.cupspkhelper.mechanism.all-edit" &&
subject.isInGroup("manager")){
return polkit.Result.YES;
}
});
I assumed this file was part of an upstream package. However, no package seems to own it:
pacman -Qo /etc/polkit-1/rules.d/40-allow-passwordless-printer-admin.rules
error: No package owns /etc/polkit-1/rules.d/40-allow-passwordless-printer-admin.rules
I would like to allow passwordless printer admin, so I would like to fix the problem rather than simply remove the file.
What is the reason for the error compiling the script?
Permissions are:
-rw-r----- 1 root root 179 Dec 6 2017 /etc/polkit-1/rules.d/40-allow-passwordless-printer-admin.rules
Polkit seemingly does not like the following syntax:
variable == "string" && expression
Try this instead:
(variable == "string") && expression