pub fn check_faillock_status(username: &str) -> Result<FaillockStatus, String>Expand description
What: Check faillock status for a user.
Inputs:
username: Username to check faillock status for.
Output:
Ok(FaillockStatus)with status information, orErr(String)on error.
§Errors
- Returns
Errif thefaillockcommand cannot be executed.
Details:
- Executes
faillock --user <username>command. - Parses output to count lines with “V” (valid attempts).
- Compares with max attempts from config to determine if locked.
- Returns status with attempt count, max attempts, lock status, and lockout duration.