mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-07-29 14:08:42 -04:00
Merge pull request #305 from DMHalford/pam-info-failed_login_counter-fix
Prevent erroneous "Login blocked after [negative number] attempts" errors
This commit is contained in:
commit
e478750814
1 changed files with 3 additions and 3 deletions
|
@ -163,9 +163,9 @@ pam_faillock_output_count="$(echo "$pam_faillock_output" | wc -l)"
|
|||
## example pam_faillock_output_count:
|
||||
## 4
|
||||
|
||||
## Do not count the first two informational textual output lines
|
||||
## (starting with "user:" and "When").
|
||||
failed_login_counter=$(( pam_faillock_output_count - 2 ))
|
||||
## Do not count the first two informational textual output lines (starting with "user:" and "When") if present,
|
||||
## whilst ensuring failed_login_counter is not set to a negative value.
|
||||
failed_login_counter=$( [ $(( pam_faillock_output_count - 2 )) -gt 0 ] && echo $(( pam_faillock_output_count - 2 )) || echo "0" )
|
||||
|
||||
## example failed_login_counter:
|
||||
## 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue