Do not pull samAccountName twice
authorVolker Lendecke <vl@samba.org>
Tue, 9 Jun 2009 19:46:04 +0000 (21:46 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 9 Jun 2009 19:46:30 +0000 (21:46 +0200)
source3/passdb/pdb_ads.c

index 4eb764f61615b39b8e9a5989dec1f5ccb65a79d8..4e63297436cf9b1adff8ab817359b10d6af340e2 100644 (file)
@@ -158,7 +158,6 @@ static NTSTATUS pdb_ads_init_sam_from_ads(struct pdb_methods *m,
                goto fail;
        }
        pdb_set_username(sam, str, PDB_SET);
                goto fail;
        }
        pdb_set_username(sam, str, PDB_SET);
-       TALLOC_FREE(str);
 
        if (pdb_ads_pull_time(entry, "lastLogon", &tmp_time)) {
                pdb_set_logon_time(sam, tmp_time, PDB_SET);
 
        if (pdb_ads_pull_time(entry, "lastLogon", &tmp_time)) {
                pdb_set_logon_time(sam, tmp_time, PDB_SET);
@@ -173,12 +172,6 @@ static NTSTATUS pdb_ads_init_sam_from_ads(struct pdb_methods *m,
                pdb_set_pass_last_set_time(sam, tmp_time, PDB_SET);
        }
 
                pdb_set_pass_last_set_time(sam, tmp_time, PDB_SET);
        }
 
-       str = tldap_talloc_single_attribute(entry, "samAccoutName",
-                                           talloc_tos());
-       if (str != NULL) {
-               pdb_set_username(sam, str, PDB_SET);
-       }
-
        str = tldap_talloc_single_attribute(entry, "displayName",
                                            talloc_tos());
        if (str != NULL) {
        str = tldap_talloc_single_attribute(entry, "displayName",
                                            talloc_tos());
        if (str != NULL) {