systemctl: fix various aspects of polkit authorization in legacy tools.#1227
Merged
poettering merged 5 commits intosystemd:masterfrom Sep 10, 2015
intelfx:systemctl-legacy-tools-polkit
Merged
systemctl: fix various aspects of polkit authorization in legacy tools.#1227poettering merged 5 commits intosystemd:masterfrom intelfx:systemctl-legacy-tools-polkit
poettering merged 5 commits intosystemd:masterfrom
intelfx:systemctl-legacy-tools-polkit
Conversation
Fixes (the main concern of) issue #213.
intelfx
referenced
this pull request
Sep 9, 2015
Prefix the action parameter with "dry-" in case the --dry-run command line switch was passed.
Member
Handle -EOPNOTSUPP and -EINPROGRESS like in start_special().
Thus we allow (non-interactive) polkit auth to kick in for legacy commands (halt, poweroff, reboot, telinit) as well. Fixes (another aspect of) issue #213.
Member
poettering
added a commit
that referenced
this pull request
Sep 10, 2015
systemctl: fix various aspects of polkit authorization in legacy tools.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This deals with multiple concerns raised in the issue #213.
First, disallow interactive polkit auth(orization|entication) if we're being called not as
systemctlbut as one of the legacy tools (halt,poweroff,reboot,shutdown,telinit).Then, relax preliminary root permission check in
halt_main()to allow (non-interactive) polkit auth to kick in the "activate special target" code path (i. e. non-root non-logind non-delayed non-forced mode).Finally, there are three ad-hoc fixes:
halt_main()to make it look similar to the call instart_special(),reboot_with_logind()) to make it clear for the user which exact operation had failed,IN_SET().(Maybe I'm overzealous with the last one.)