mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
ITS#7596 Report correct number of grace authentications left
This commit is contained in:
parent
3925b8e009
commit
d1799a5023
@ -703,7 +703,7 @@ create_passcontrol( Operation *op, int exptime, int grace, LDAPPasswordPolicyErr
|
||||
}
|
||||
ber_printf( ber, "tO", PPOLICY_WARNING, &bv );
|
||||
ch_free( bv.bv_val );
|
||||
} else if ( grace > 0 ) {
|
||||
} else if ( grace >= 0 ) {
|
||||
ber_init2( b2, NULL, LBER_USE_DER );
|
||||
ber_printf( b2, "ti", PPOLICY_GRACE, grace );
|
||||
rc = ber_flatten2( b2, &bv, 1 );
|
||||
@ -1658,8 +1658,10 @@ grace:
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"ppolicy_bind: Entry %s has an expired password: %d grace logins\n",
|
||||
e->e_name.bv_val, ngut );
|
||||
|
||||
if (ngut < 1) {
|
||||
|
||||
ngut--;
|
||||
|
||||
if (ngut < 0) {
|
||||
ppb->pErr = PP_passwordExpired;
|
||||
rs->sr_err = LDAP_INVALID_CREDENTIALS;
|
||||
goto done;
|
||||
|
Loading…
Reference in New Issue
Block a user