diff options
author | Nathan Kinder <nkinder@redhat.com> | 2009-01-15 18:24:48 +0000 |
---|---|---|
committer | Nathan Kinder <nkinder@redhat.com> | 2009-01-15 18:24:48 +0000 |
commit | bf00ddf580bfd3f9340ab7703c23d867ad5524af (patch) | |
tree | acc9a2fb22abd377bf4dba5732031fabd653b8b9 /ldap/servers/slapd/modify.c | |
parent | 03ab7a78d9396e4583aa5fdcb70515c57512e96a (diff) | |
download | ds-bf00ddf580bfd3f9340ab7703c23d867ad5524af.tar.gz ds-bf00ddf580bfd3f9340ab7703c23d867ad5524af.tar.xz ds-bf00ddf580bfd3f9340ab7703c23d867ad5524af.zip |
Resolves: 184141
Summary: Make password modify extop work properly with the password policy control.
Diffstat (limited to 'ldap/servers/slapd/modify.c')
-rw-r--r-- | ldap/servers/slapd/modify.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/ldap/servers/slapd/modify.c b/ldap/servers/slapd/modify.c index 4fd2a8b2..09ccd424 100644 --- a/ldap/servers/slapd/modify.c +++ b/ldap/servers/slapd/modify.c @@ -437,21 +437,30 @@ void slapi_modify_internal_set_pb (Slapi_PBlock *pb, const char *dn, LDAPMod **m static int modify_internal_pb (Slapi_PBlock *pb) { - LDAPControl **controls; + LDAPControl **controls; + LDAPControl *pwpolicy_ctrl; Operation *op; - int opresult = 0; + int opresult = 0; LDAPMod **normalized_mods = NULL; LDAPMod **mods; LDAPMod **mod; Slapi_Mods smods; - int pw_change = 0; - char *old_pw = NULL; + int pw_change = 0; + char *old_pw = NULL; PR_ASSERT (pb != NULL); slapi_pblock_get(pb, SLAPI_MODIFY_MODS, &mods); slapi_pblock_get(pb, SLAPI_CONTROLS_ARG, &controls); + /* See if pwpolicy control is present. We need to do + * this before we call op_shared_allow_pw_change() since + * it looks for SLAPI_PWPOLICY in the pblock to determine + * if the response contorl is needed. */ + pwpolicy_ctrl = slapi_control_present( controls, + LDAP_X_CONTROL_PWPOLICY_REQUEST, NULL, NULL ); + slapi_pblock_set( pb, SLAPI_PWPOLICY, &pwpolicy_ctrl ); + if(mods == NULL) { opresult = LDAP_PARAM_ERROR; |