mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-03-01 14:15:49 +08:00
ITS#8234 revert to default policy on failure
This commit is contained in:
parent
572ad2b037
commit
1b7a5871c2
@ -468,6 +468,18 @@ add_passcontrol( Operation *op, SlapReply *rs, LDAPControl *ctrl )
|
||||
return oldctrls;
|
||||
}
|
||||
|
||||
static void
|
||||
ppolicy_get_default( PassPolicy *pp )
|
||||
{
|
||||
memset( pp, 0, sizeof(PassPolicy) );
|
||||
|
||||
pp->ad = slap_schema.si_ad_userPassword;
|
||||
|
||||
/* Users can change their own password by default */
|
||||
pp->pwdAllowUserChange = 1;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ppolicy_get( Operation *op, Entry *e, PassPolicy *pp )
|
||||
{
|
||||
@ -481,12 +493,7 @@ ppolicy_get( Operation *op, Entry *e, PassPolicy *pp )
|
||||
const char *text;
|
||||
#endif
|
||||
|
||||
memset( pp, 0, sizeof(PassPolicy) );
|
||||
|
||||
pp->ad = slap_schema.si_ad_userPassword;
|
||||
|
||||
/* Users can change their own password by default */
|
||||
pp->pwdAllowUserChange = 1;
|
||||
ppolicy_get_default( pp );
|
||||
|
||||
if ((a = attr_find( e->e_attrs, ad_pwdPolicySubentry )) == NULL) {
|
||||
/*
|
||||
@ -584,6 +591,9 @@ defaultpol:
|
||||
|
||||
Debug( LDAP_DEBUG_TRACE,
|
||||
"ppolicy_get: using default policy\n", 0, 0, 0 );
|
||||
|
||||
ppolicy_get_default( pp );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user