morph
morph copied to clipboard
Skip sudo invocation if running user is sudo
This one has been floating around for a while #160 and bumped into a situation with systems without sudo.
I did the simple steps of checking if the user was running as root in the sudo context and skipping. I do think it might be a little bit more logical to check for the user before switching between the sudo and non-sudo context, but the code changes were longer. If that's preferred I'll switch it up.
This is also probably my first steps for adding support for other privesc methods (as sudo-rs is broken right now due to the lack of -p support).