[Pkg-openldap-devel] [openldap] 33/208: ITS#8234 revert to default policy on failure
Ryan Tandy
rtandy-guest at moszumanska.debian.org
Thu Dec 31 23:54:09 UTC 2015
This is an automated email from the git hooks/post-receive script.
rtandy-guest pushed a commit to branch master
in repository openldap.
commit 6b2a341f34b1ecb8e6def029c0d219e2fbba665c
Author: Ryan Tandy <ryan at nardis.ca>
Date: Tue Sep 1 19:19:57 2015 -0700
ITS#8234 revert to default policy on failure
---
servers/slapd/overlays/ppolicy.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/servers/slapd/overlays/ppolicy.c b/servers/slapd/overlays/ppolicy.c
index 2ba376b..9870e8f 100644
--- a/servers/slapd/overlays/ppolicy.c
+++ b/servers/slapd/overlays/ppolicy.c
@@ -465,6 +465,18 @@ add_passcontrol( Operation *op, SlapReply *rs, LDAPControl *ctrl )
}
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 )
{
slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
@@ -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;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-openldap/openldap.git
More information about the Pkg-openldap-devel
mailing list