mirror of
https://github.com/linux-pam/linux-pam.git
synced 2024-11-27 11:43:38 +08:00
pam_unix: sp_min and sp_warn must be at least 1
If sp_min or sp_warn are set to 0 or empty (-1), then their respective features are disabled according to shadow(5). Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
This commit is contained in:
parent
9ebc14085a
commit
297f0b554e
@ -337,7 +337,7 @@ PAMH_ARG_DECL(int check_shadow_expiry,
|
||||
D(("need a new password 2"));
|
||||
return PAM_NEW_AUTHTOK_REQD;
|
||||
}
|
||||
if (spent->sp_warn >= 0) {
|
||||
if (spent->sp_warn > 0) {
|
||||
long warn = spent->sp_warn > spent->sp_max ? -1 :
|
||||
spent->sp_max - spent->sp_warn;
|
||||
if (passed >= warn) {
|
||||
@ -346,7 +346,7 @@ PAMH_ARG_DECL(int check_shadow_expiry,
|
||||
}
|
||||
}
|
||||
}
|
||||
if (spent->sp_min >= 0 && passed < spent->sp_min) {
|
||||
if (spent->sp_min > 0 && passed < spent->sp_min) {
|
||||
/*
|
||||
* The last password change was too recent. This error will be ignored
|
||||
* if no password change is attempted.
|
||||
|
Loading…
Reference in New Issue
Block a user