Rework logic in _sudo() and add support for sudo-rs#584
Merged
Conversation
mix of tabs and whitespaces
If --sudo was supplied it would behave differently than without. More verbose, different output, but in general the same behaviour as without. Additionally "--sudo sudo" wasn't working. Now this is organized in one branch instead of two. Has the benefit that instead of a direct failure when the argument of "--sudo" isn't found, it will then fallback to sudo and doas. Both tools were checked upon if --sudo wasn't used and counted as defaults. Additionally adjust the man page in that regard.
Member
|
Excellent! much more readable now too. |
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.
The
sudowrapper_sudohas different behaviour depending if--sudois used or not. It is more chatty with-D,--sudo sudodoesn't work and code duplications which could theoretically be avoided.Therefore an attempt to make the function more general and instead of the two branches just provide one. The logic itself is inspired by the structure from the
_pinentrywrapper.And add support for
sudo-rsNot sure about adding the verbosity in general... It is rather chatty, but also a reminder for all those places were privilege escalation is needed :D