Fix bug 4901
authorVolker Lendecke <vl@samba.org>
Fri, 14 Mar 2008 17:01:06 +0000 (18:01 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 14 Mar 2008 17:01:23 +0000 (18:01 +0100)
WHATSNEW.txt
source/passdb/pdb_ldap.c

index 3928e6d1811771e9e706cb1e2f7592d23d45d3cf..a9ca3526b39a7a2d13cadcbfff1188ca2575bf22 100644 (file)
@@ -305,6 +305,7 @@ o   Volker Lendecke <vl@samba.org>
     * Add implicit temporary talloc contexts via talloc_stack().
     * Speed up the smbclient "get" command
     * Add the aio_fork module
+    * Fix bug 4901
 
 o   Derrell Lipman <derrell@samba.org>
     * Modified libsmbclient API for more easily maintaining ABI compatibility
index dec9b5bafb57ce9989f310213027cdb47086277c..d941abb00e68763279dda1dfb0a32e49c07f8581 100644 (file)
@@ -1913,8 +1913,9 @@ static NTSTATUS ldapsam_update_sam_account(struct pdb_methods *my_methods, struc
                        ldap_mods_free(mods,True);
                return NT_STATUS_UNSUCCESSFUL;
        }
-       
-       if (mods == NULL) {
+
+       if ((lp_ldap_passwd_sync() != LDAP_PASSWD_SYNC_ONLY)
+           && (mods == NULL)) {
                DEBUG(4,("ldapsam_update_sam_account: mods is empty: nothing to update for user: %s\n",
                         pdb_get_username(newpwd)));
                SAFE_FREE(dn);
@@ -1922,7 +1923,11 @@ static NTSTATUS ldapsam_update_sam_account(struct pdb_methods *my_methods, struc
        }
        
        ret = ldapsam_modify_entry(my_methods,newpwd,dn,mods,LDAP_MOD_REPLACE, element_is_changed);
-       ldap_mods_free(mods,True);
+
+       if (mods != NULL) {
+               ldap_mods_free(mods,True);
+       }
+
        SAFE_FREE(dn);
 
        /*