pub fn validate_password(
tool: PrivilegeTool,
password: &str,
) -> Result<bool, String>Expand description
What: Validate a password against the privilege tool.
Inputs:
tool: Resolved privilege tool.password: Password to validate.
Output:
Ok(true)if valid,Ok(false)if invalid.Errif the tool doesn’t support stdin password or the check fails.
§Errors
- Returns
Errif the tool does not support stdin password validation. - Returns
Errif the validation command cannot be executed.
Details:
- Only works for tools with
supports_stdin_password(currently sudo only). - First invalidates cached credentials, then tests the password.