Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions usr/libexec/security-misc/pam-info#security-misc-shared
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ deny=3
if test -f /etc/security/faillock.conf ; then
deny_line=$(grep --invert-match "#" -- /etc/security/faillock.conf | grep -- "deny =") || true
deny="$(printf '%s\n' "$deny_line" | str_replace "=" "" | str_replace "deny" "" | str_replace " " "")"
## Restore the default if no uncommented 'deny =' line was found; an empty
## value would slip past the numeric guard below and cause a false lockout.
[ -n "$deny" ] || deny=3
Comment on lines +251 to +253

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core of the change looks right, but the comment is wrong; this script doesn't cause a lockout, it just tells the user when they have been locked out. So maybe:

Suggested change
## Restore the default if no uncommented 'deny =' line was found; an empty
## value would slip past the numeric guard below and cause a false lockout.
[ -n "$deny" ] || deny=3
## Restore the default if no uncommented 'deny =' line was found; an empty
## value would slip past the numeric guard below and incorrectly report a
## lockout.
[ -n "$deny" ] || deny=3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maybebyte I'm happy to merge this as-is and fix the comment after, or you can change it if you'd prefer.

## Example:
#deny=50
fi
Expand Down