r10170: Fix for #3056:
authorGünther Deschner <gd@samba.org>
Mon, 12 Sep 2005 11:56:36 +0000 (11:56 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:03:35 +0000 (11:03 -0500)
Allow to include BUILTIN to the mapping table also when
"allow trusted domains" is disabled.

Guenther

source/sam/idmap_rid.c

index a23da3e5789633215fa61a6f9491b1b175de826b..0ba97946965ce65d01554d22cfba56f7449f08bc 100644 (file)
@@ -159,11 +159,10 @@ static NTSTATUS rid_idmap_get_domains(uint32 *num_domains, fstring **domain_name
        char **trusted_domain_names;
        DOM_SID *trusted_domain_sids;
        uint32 enum_ctx = 0;
-       DOM_SID builtin_sid;
        int own_domains = 2;
 
        /* put the results together */
-       *num_domains = 1;
+       *num_domains = 2;
        *domain_names = SMB_MALLOC_ARRAY(fstring, *num_domains);
        *domain_sids = SMB_MALLOC_ARRAY(DOM_SID, *num_domains);
 
@@ -177,6 +176,10 @@ static NTSTATUS rid_idmap_get_domains(uint32 *num_domains, fstring **domain_name
                }
                sid_copy(&(*domain_sids)[0], &sid);
 
+               /* add BUILTIN */
+               fstrcpy((*domain_names)[1], "BUILTIN");
+               sid_copy(&(*domain_sids)[1], &global_sid_Builtin);
+
                return NT_STATUS_OK;
        }
 
@@ -286,9 +289,8 @@ static NTSTATUS rid_idmap_get_domains(uint32 *num_domains, fstring **domain_name
        sid_copy(&(*domain_sids)[0], domain_sid);
 
        /* then add BUILTIN */
-       string_to_sid(&builtin_sid, "S-1-5-32");
        fstrcpy((*domain_names)[1], "BUILTIN");
-       sid_copy(&(*domain_sids)[1], &builtin_sid);
+       sid_copy(&(*domain_sids)[1], &global_sid_Builtin);
 
        /* then add my local sid */
        if (!sid_equal(domain_sid, get_global_sam_sid())) {