Commit 6b2a341f authored by Ryan Tandy's avatar Ryan Tandy Committed by Quanah Gibson-Mount
Browse files

ITS#8234 revert to default policy on failure

parent 24019415
......@@ -464,6 +464,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 )
{
......@@ -477,12 +489,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) {
/*
......@@ -580,6 +587,9 @@ defaultpol:
Debug( LDAP_DEBUG_TRACE,
"ppolicy_get: using default policy\n", 0, 0, 0 );
ppolicy_get_default( pp );
return;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment