summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-06-20 20:05:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:18:53 -0500
commitca8b86c51a5941555d61b02b82fb6b7c4e674f08 (patch)
treeab8c719fc3eaa4fcc6375f077d6c0432b3f0b990 /source3/passdb
parent4340b7cea74203799f7cd5d2457cbe062b42425c (diff)
downloadsamba-ca8b86c51a5941555d61b02b82fb6b7c4e674f08.tar.gz
samba-ca8b86c51a5941555d61b02b82fb6b7c4e674f08.tar.bz2
samba-ca8b86c51a5941555d61b02b82fb6b7c4e674f08.zip
r16427: Fix bug # 3848. Thanks to Wilco Baan Hofman for testing the release candidate!
Volker (This used to be commit adf2dcce09ae29a8c1677b25e1cd5f022b804d01)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_ldap.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 2a824c137f..4a9794e186 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -1796,6 +1796,19 @@ static NTSTATUS ldapsam_update_sam_account(struct pdb_methods *my_methods, struc
ldap_mods_free(mods,True);
SAFE_FREE(dn);
+ /*
+ * We need to set the backend private data to NULL here. For example
+ * setuserinfo level 25 does a pdb_update_sam_account twice on the
+ * same one, and with the explicit delete / add logic for attribute
+ * values the second time we would use the wrong "old" value which
+ * does not exist in LDAP anymore. Thus the LDAP server would refuse
+ * the update.
+ * The existing LDAPMessage is still being auto-freed by the
+ * destructor.
+ */
+ pdb_set_backend_private_data(newpwd, NULL, NULL, my_methods,
+ PDB_CHANGED);
+
if (!NT_STATUS_IS_OK(ret)) {
return ret;
}