mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-30 03:29:35 -05:00
ITS#8234 revert to default policy on failure
This commit is contained in:
parent
572ad2b037
commit
1b7a5871c2
1 changed files with 16 additions and 6 deletions
|
|
@ -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 a new issue