s3: Fix bug 8455 -- Samba PDC is looking up only primary user group
authorVolker Lendecke <vl@samba.org>
Fri, 16 Sep 2011 13:45:47 +0000 (15:45 +0200)
committerVolker Lendecke <vlendec@samba.org>
Fri, 16 Sep 2011 22:51:27 +0000 (00:51 +0200)
group_sids_to_info3 does a sid_peek_check_rid on the domain sid before adding
the rids to the array. If the domain sid is 0x0, then the check will always
fail.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sat Sep 17 00:51:27 CEST 2011 on sn-devel-104

source3/auth/server_info.c

index dec99b669e0a29342b693ecf4975e6d9e1c2fd8f..fd2101024fffd019f8f908fd7baaf723c35c9550 100644 (file)
@@ -428,6 +428,13 @@ NTSTATUS samu_to_SamInfo3(TALLOC_CTX *mem_ctx,
        info3->base.logon_count = pdb_get_logon_count(samu);
        info3->base.bad_password_count = pdb_get_bad_password_count(samu);
 
+       info3->base.domain.string = talloc_strdup(info3,
+                                                 pdb_get_domain(samu));
+       RET_NOMEM(info3->base.domain.string);
+
+       info3->base.domain_sid = dom_sid_dup(info3, &domain_sid);
+       RET_NOMEM(info3->base.domain_sid);
+
        status = pdb_enum_group_memberships(mem_ctx, samu,
                                            &group_sids, &gids,
                                            &num_group_sids);
@@ -458,13 +465,6 @@ NTSTATUS samu_to_SamInfo3(TALLOC_CTX *mem_ctx,
                RET_NOMEM(info3->base.logon_server.string);
        }
 
-       info3->base.domain.string = talloc_strdup(info3,
-                                                 pdb_get_domain(samu));
-       RET_NOMEM(info3->base.domain.string);
-
-       info3->base.domain_sid = dom_sid_dup(info3, &domain_sid);
-       RET_NOMEM(info3->base.domain_sid);
-
        info3->base.acct_flags = pdb_get_acct_ctrl(samu);
 
        *_info3 = info3;