summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-01-02 18:20:23 -0800
committerJeremy Allison <jra@samba.org>2008-01-02 18:20:23 -0800
commitcfcdeb52bf0184874980aebaea602bd2ee5ee411 (patch)
tree759a13a026845d0c1ffc6297ae404c856c2ad4dd
parentcc957c7f6d1956740feb7169b45f388d387e175a (diff)
downloadsamba-cfcdeb52bf0184874980aebaea602bd2ee5ee411.tar.gz
samba-cfcdeb52bf0184874980aebaea602bd2ee5ee411.tar.bz2
samba-cfcdeb52bf0184874980aebaea602bd2ee5ee411.zip
Fix for bug #5163 from Laurent Pinchart <pinchart@skynet.be>
Failure to change password in ldap is mapped to NT_STATUS_UNSUCCESSFUL unconditionally. Jeremy. (This used to be commit 9369d6e907a49da1fbf2a5690118412b8d1a0383)
-rw-r--r--source3/passdb/pdb_ldap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index b638219466..205b178a93 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -1768,6 +1768,10 @@ static NTSTATUS ldapsam_modify_entry(struct pdb_methods *my_methods,
pdb_get_username(newpwd), ldap_err2string(rc), ld_error?ld_error:"unknown"));
SAFE_FREE(ld_error);
ber_bvfree(bv);
+#if defined(LDAP_CONSTRAINT_VIOLATION)
+ if (rc == LDAP_CONSTRAINT_VIOLATION)
+ return NT_STATUS_PASSWORD_RESTRICTION;
+#endif
return NT_STATUS_UNSUCCESSFUL;
} else {
DEBUG(3,("ldapsam_modify_entry: LDAP Password changed for user %s\n",pdb_get_username(newpwd)));