r9660: real fix for group enumeration bug in 3.0.20; only affected the ldapsam code
authorGerald Carter <jerry@samba.org>
Fri, 26 Aug 2005 18:57:32 +0000 (18:57 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:03:24 +0000 (11:03 -0500)
source/passdb/pdb_ldap.c
source/rpc_parse/parse_samr.c
source/rpc_server/srv_samr_nt.c

index ee7a1f5b4cbb093cffdd817e6113903960100a66..17ff053783cd8a7f3a42a00928e1b4fe1dbbb1da 100644 (file)
@@ -3692,22 +3692,23 @@ static BOOL ldapgroup2displayentry(struct ldap_search_state *state,
                return False;
        }
 
+       /* verify that the 'cn' attribute exists */
+
        vals = ldap_get_values(ld, entry, "cn");
        if ((vals == NULL) || (vals[0] == NULL)) {
                DEBUG(5, ("\"cn\" not found\n"));
                return False;
        }
-       pull_utf8_talloc(mem_ctx,
-                        CONST_DISCARD(char **, &result->account_name),
-                        vals[0]);
        ldap_value_free(vals);
 
+       /* display name is the NT group name */
+
        vals = ldap_get_values(ld, entry, "displayName");
        if ((vals == NULL) || (vals[0] == NULL))
                DEBUG(8, ("\"displayName\" not found\n"));
        else
                pull_utf8_talloc(mem_ctx,
-                                CONST_DISCARD(char **, &result->fullname),
+                                CONST_DISCARD(char **, &result->account_name),
                                 vals[0]);
        ldap_value_free(vals);
 
index 45a1f0e23cc6d069e494c122a87f284937d06aea..6b0193c6e46e58a402c000b58b8541c1185e09e6 100644 (file)
@@ -1720,7 +1720,7 @@ NTSTATUS init_sam_dispinfo_3(TALLOC_CTX *ctx, SAM_DISPINFO_3 **sam,
                DEBUG(11, ("init_sam_dispinfo_3: entry: %d\n",i));
 
                init_unistr2(&(*sam)->str[i].uni_grp_name,
-                            entries[i].fullname, UNI_FLAGS_NONE);
+                            entries[i].account_name, UNI_FLAGS_NONE);
                init_unistr2(&(*sam)->str[i].uni_grp_desc,
                             entries[i].description, UNI_FLAGS_NONE);
 
index 05aa6fe48468365a53f9636d3def6ae63d3ffebb..1f79ce5c1441be3969fcb98e87cb52313ce43792 100644 (file)
@@ -670,7 +670,7 @@ static void make_group_sam_entry_list(TALLOC_CTX *ctx, SAM_ENTRY **sam_pp,
                /*
                 * JRA. I think this should include the null. TNG does not.
                 */
-               init_unistr2(&uni_name[i], entries[i].fullname,
+               init_unistr2(&uni_name[i], entries[i].account_name,
                             UNI_STR_TERMINATE);
                init_sam_entry(&sam[i], &uni_name[i], entries[i].rid);
        }