From 0dc3cd75a175a33a3883aa50a324db9699cb4c6b Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 22 Jan 2009 11:10:01 +0100 Subject: s3:groupdb: allocate a gid after allocating a rid in pdb_default_create_alias() Michael --- source3/groupdb/mapping.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source3/groupdb') diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c index 4cfe9957f4..5e2e54487e 100644 --- a/source3/groupdb/mapping.c +++ b/source3/groupdb/mapping.c @@ -486,21 +486,22 @@ NTSTATUS pdb_default_create_alias(struct pdb_methods *methods, return NT_STATUS_ALIAS_EXISTS; } - if (!winbind_allocate_gid(&gid)) { - DEBUG(3, ("Could not get a gid out of winbind\n")); + if (!pdb_new_rid(&new_rid)) { + DEBUG(0, ("Could not allocate a RID.\n")); return NT_STATUS_ACCESS_DENIED; } - if (!pdb_new_rid(&new_rid)) { - DEBUG(0, ("Could not allocate a RID -- wasted a gid :-(\n")); + sid_compose(&sid, get_global_sam_sid(), new_rid); + + if (!winbind_allocate_gid(&gid)) { + DEBUG(3, ("Could not get a gid out of winbind - " + "wasted a rid :-(\n")); return NT_STATUS_ACCESS_DENIED; } DEBUG(10, ("Creating alias %s with gid %u and rid %u\n", name, (unsigned int)gid, (unsigned int)new_rid)); - sid_compose(&sid, get_global_sam_sid(), new_rid); - map.gid = gid; sid_copy(&map.sid, &sid); map.sid_name_use = SID_NAME_ALIAS; -- cgit