Forum Discussion

RogueScholar's avatar
RogueScholar
Occasional Contributor
2 years ago

Linux nightly PolicyKit rules file syntax error

Been having some PolicyKit errors in the syslog for the past couple days and tracked it down to a security policy implemented via PolicyKit for 1P. The file is /usr/share/polkit-1/rules.d/01-1password_wheel.rules and though the parser when run in verbose mode reports the syntax error on line 7, in fact the issue lies in an unpaired parenthesis present on line 5. The patch to resolve the issue is:

```
/* Allow members of the wheel group to execute the defined actions without
* password authentication, similar to "sudo NOPASSWD:" */

polkit.addRule(function(action, subject) {
- if ((action.id == "com.1password.1Password.unlock" &&
+ if (action.id == "com.1password.1Password.unlock" &&
subject.isInGroup("wheel"))
{
return polkit.Result.YES;
}
});
```

It may be worth adding a test to your CI/CD that executes /usr/lib/packagekit/packagekitd --verbose once the file is installed on the buildsystem and checks for SyntaxError in the output to prevent repeat occurrences as the policy evolves. The verbatim syslog entry this generated was Error compiling script /usr/share/polkit-1/rules.d/01-1password_wheel.rules: SyntaxError: parse error (line 7).

Cheers,
Peter


1Password Version: 8.10.28 (81028010)
Extension Version: 2.21.23 (22102300)
OS Version: Kubuntu Linux 23.10
Browser: Vivaldi Snapshot 6.6.3271.33

No RepliesBe the first to reply