Repository navigation
polkit rules generation - #100
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-resolvedto perform its various DBus calls when run as an unprivileged user.Motivation
update-systemd-resolvedadds or removesorg.freedesktop.resolve1DBus call types.Summary of changes
update-systemd-resolved print-polkit-rules, with various options as documented in theREADME.mdchanges.update-systemd-resolvedmaintainers prefer.Caveats
"$@") as a JSON array.jqis used for this, if available, falling back to a pure-shell implementation on systems wherejqis 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 thejsonorsimplejsonmodule, 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-resolveddoes not yet implement--helpfor existing options.update-systemd-resolveddumps 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-resolvedto do its thing). Instead, maybeupdate-systemd-resolvedcould 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!