Skip to main content

validate_sudo_password

Function validate_sudo_password 

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

What: Validate a privilege tool password without executing any command.

Inputs:

  • password: Password to validate.

Output:

  • Ok(true) if password is valid, Ok(false) if invalid, or Err(String) on error.

ยงErrors

  • Returns Err if the validation command cannot be executed (e.g., tool not available).
  • Returns Err if the active tool does not support password validation (e.g., doas).

Details: