From 1fe2c5f9f0df811d800bebd8a3e174ed9b0e50fa Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 12 Sep 2005 11:56:36 +0000 Subject: r10170: Fix for #3056: Allow to include BUILTIN to the mapping table also when "allow trusted domains" is disabled. Guenther (This used to be commit 3ccb1913a771a187ee61a87869966beb7645f2f9) --- source3/sam/idmap_rid.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source3/sam/idmap_rid.c b/source3/sam/idmap_rid.c index a23da3e578..0ba9794696 100644 --- a/source3/sam/idmap_rid.c +++ b/source3/sam/idmap_rid.c @@ -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())) { -- cgit