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, orErr(String)on error.
ยงErrors
- Returns
Errif the validation command cannot be executed (e.g., tool not available). - Returns
Errif the active tool does not support password validation (e.g., doas).
Details:
- Delegates to
crate::logic::privilege::validate_password. - Only works for tools that support stdin password piping (currently sudo).
- For doas, returns an error since doas cannot validate passwords via stdin.