我有一个工作站(运行 Arch Linux),它在日志中显示以下消息。
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>
该文件的内容如下:
polkit.addRule(function(action, subject) {
if (action.id == "org.opensuse.cupspkhelper.mechanism.all-edit" &&
subject.isInGroup("manager")){
return polkit.Result.YES;
}
});
我以为这个文件是上游软件包的一部分。但是,似乎没有软件包拥有它:
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
我想允许无密码打印机管理员,所以我想解决这个问题而不是简单地删除这个文件。
编译脚本出错的原因是什么?
权限包括:
-rw-r----- 1 root root 179 Dec 6 2017 /etc/polkit-1/rules.d/40-allow-passwordless-printer-admin.rules
答案1
Polkit 似乎不喜欢以下语法:
variable == "string" && expression
尝试一下这个:
(variable == "string") && expression