r16124: catch a couple of fixes from Guenther
authorGerald Carter <jerry@samba.org>
Fri, 9 Jun 2006 14:59:04 +0000 (14:59 +0000)
committerGerald Carter <jerry@samba.org>
Fri, 9 Jun 2006 14:59:04 +0000 (14:59 +0000)
WHATSNEW.txt
source/include/smbldap.h
source/lib/smbldap.c
source/passdb/pdb_ldap.c

index e65dbfa75eb44c935fdebf2685ea2c43f61846dc..d37a40e82e872641f016045e96ae7a4f0bd87293 100644 (file)
@@ -65,6 +65,9 @@ o   Guenther Deschner <gd@samba.org>
     * Correct "net ads changetrustpw" to use the sAMAccountName.
     * Fix winbindd in ADS domains by removing code using the 
       UPN and rely upon the sAMAccountName.
+    * Fix a eDir related memory leak.
+    * Don't try to add the sn attribute twice to an LDAP 
+      inetOrgPerson + samSamAccount entry.
 
 
 o   Aleksey Fedoseev <fedoseev@ru.ibm.com>
index 6cfde13f4a9df19a9aaefea0784886c19b6bbccd..ae54e66b369e33841bcd02ba1d2d9ad725cd28f8 100644 (file)
@@ -101,6 +101,7 @@ struct smbldap_state;
 #define LDAP_ATTR_MOD_TIMESTAMP         41
 #define LDAP_ATTR_LOGON_HOURS          42 
 #define LDAP_ATTR_TRUST_PASSWD_FLAGS    43
+#define LDAP_ATTR_SN                   44
 
 
 typedef struct _attrib_map_entry {
index dfa6782afef2cd4e53f669710914ea1d3a147260..5b18f4e31137990075edde832b98f8bba7ab1e5f 100644 (file)
@@ -52,6 +52,7 @@ ATTRIB_MAP_ENTRY attrib_map_v22[] = {
        { LDAP_ATTR_LOGOFF_TIME,        "logoffTime"    },
        { LDAP_ATTR_KICKOFF_TIME,       "kickoffTime"   },
        { LDAP_ATTR_CN,                 "cn"            },
+       { LDAP_ATTR_SN,                 "sn"            },
        { LDAP_ATTR_DISPLAY_NAME,       "displayName"   },
        { LDAP_ATTR_HOME_PATH,          "smbHome"       },
        { LDAP_ATTR_HOME_DRIVE,         "homeDrive"     },
@@ -106,6 +107,7 @@ ATTRIB_MAP_ENTRY attrib_map_v30[] = {
        { LDAP_ATTR_LOGOFF_TIME,        "sambaLogoffTime"       },
        { LDAP_ATTR_KICKOFF_TIME,       "sambaKickoffTime"      },
        { LDAP_ATTR_CN,                 "cn"                    },
+       { LDAP_ATTR_SN,                 "sn"                    },
        { LDAP_ATTR_DISPLAY_NAME,       "displayName"           },
        { LDAP_ATTR_HOME_DRIVE,         "sambaHomeDrive"        },
        { LDAP_ATTR_HOME_PATH,          "sambaHomePath"         },
index fbc6378f685879bd595530778923f83514763251..79c1eda459c4ee4d0805cbade8784c0815d61fa1 100644 (file)
@@ -730,14 +730,21 @@ static BOOL init_sam_from_ldap(struct ldapsam_privates *ldap_state,
                        pwd_len = sizeof(clear_text_pw);
                        if (pdb_nds_get_password(ldap_state->smbldap_state, user_dn, &pwd_len, clear_text_pw) == LDAP_SUCCESS) {
                                nt_lm_owf_gen(clear_text_pw, smbntpwd, smblmpwd);
-                               if (!pdb_set_lanman_passwd(sampass, smblmpwd, PDB_SET))
+                               if (!pdb_set_lanman_passwd(sampass, smblmpwd, PDB_SET)) {
+                                       SAFE_FREE(user_dn);
                                        return False;
+                               }
                                ZERO_STRUCT(smblmpwd);
-                               if (!pdb_set_nt_passwd(sampass, smbntpwd, PDB_SET))
+                               if (!pdb_set_nt_passwd(sampass, smbntpwd, PDB_SET)) {
+                                       SAFE_FREE(user_dn);
                                        return False;
+                               }
                                ZERO_STRUCT(smbntpwd);
                                use_samba_attrs = False;
                        }
+
+                       SAFE_FREE(user_dn);
+
                } else {
                        DEBUG(0, ("init_sam_from_ldap: failed to get user_dn for '%s'\n", username));
                }