Skip to main content

sudo_user

Function sudo_user 

Source
pub fn sudo_user() -> Option<SudoUser>
Expand description

Returns info about the real user behind sudo, if applicable.

Looks up SUDO_USER in the environment. Returns None if the variable is unset, empty, or set to “root” (running sudo as root is a no-op).