-
Notifications
You must be signed in to change notification settings - Fork 94
polkit rules generation #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Also: having trouble with my personal Travis CI account, so here's a link to a passing build on builds.sr.ht. |
f83084c
to
6264044
Compare
fd9037e
to
11f5ac5
Compare
11f5ac5
to
c4bf690
Compare
c4bf690
to
fae8367
Compare
9d8e4c2
to
980072e
Compare
@piotr-dobrogost -- since you gave this PR a 👍 a while back, any chance I could impose upon you for a review? Please and thank you 😃 . |
I have implemented JSON serialization using Perl and Python. |
8acd6c2
to
5047262
Compare
that prints a polkit rules definition to standard output. These rules permit specified users and/or groups to perform the DBus calls necessary for update-systemd-resolved's proper operation.
when the prerequisites for such are available.
when building polkit rules. [skip ci]
f214415
to
d81dcd0
Compare
This is a draft pull request that introduces the ability to dynamically generate polkit rules that allow
update-systemd-resolved
to perform its various DBus calls when run as an unprivileged user.Motivation
update-systemd-resolved
adds or removesorg.freedesktop.resolve1
DBus call types.Summary of changes
update-systemd-resolved print-polkit-rules
, with various options as documented in theREADME.md
changes.update-systemd-resolved
maintainers prefer.Caveats
"$@"
) as a JSON array.jq
is used for this, if available, falling back to a pure-shell implementation on systems wherejq
is absent. This fallback implementation is, to put it kindly, dodgy in the extreme: it escapes"
characters and passes everything else through untouched. This is a potential security hole, if a bad actor can somehow influence the list of arguments passed to the JSON-generating function. I could implement other fallback functions (e.g., using Python and thejson
orsimplejson
module, if available, using Perl andJSON::PP
,JSON::XS
, etc., if available, and so on). WDYT?TODO
Help text. Omitted for the time being becauseGoing to save this for a future PR.update-systemd-resolved
does not yet implement--help
for existing options.update-systemd-resolved
dumps a polkit rules definition to the system journal when certain operations fail (to let the user know that how they may need to update their polkit rules to allowupdate-systemd-resolved
to do its thing). Instead, maybeupdate-systemd-resolved
could print the polkit rules generation command to the journal -- e.g.,update-system-resolved --polkit-allowed-user <uid> --polkit-allowed-group <gid>
.Thanks in advance for your consideration!