Skip to main content

authenticate_sudo

Function authenticate_sudo 

Source
pub fn authenticate_sudo(password: &str) -> Result<bool>
Expand description

Attempt to authenticate as root using sudo -S -v with the given password piped over stdin. Returns Ok(true) if authentication succeeded, Ok(false) if the password was rejected, and Err if sudo could not be invoked at all.