summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-01-22 11:10:01 +0100
committerMichael Adam <obnox@samba.org>2010-08-14 02:10:29 +0200
commit0dc3cd75a175a33a3883aa50a324db9699cb4c6b (patch)
tree92f6bcfca94e86679d434e2e7a8ec480386a0575 /source3
parentb28371b9a4145d5d84d290a5fece40536838b7ed (diff)
downloadsamba-0dc3cd75a175a33a3883aa50a324db9699cb4c6b.tar.gz
samba-0dc3cd75a175a33a3883aa50a324db9699cb4c6b.tar.bz2
samba-0dc3cd75a175a33a3883aa50a324db9699cb4c6b.zip
s3:groupdb: allocate a gid after allocating a rid in pdb_default_create_alias()
Michael
Diffstat (limited to 'source3')
-rw-r--r--source3/groupdb/mapping.c13
1 files changed, 7 insertions, 6 deletions
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;