diff options
author | Volker Lendecke <vlendec@samba.org> | 2005-12-03 18:34:13 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:43 -0500 |
commit | 05ac2de0df78d22ad5afb42ea5c72ba17bef8395 (patch) | |
tree | f4968eaab779b3f09dfac41e34f6088f32c38463 /source3/groupdb | |
parent | 678f13c761bea7b4dc4b96c4c1a7d65ee143181c (diff) | |
download | samba-05ac2de0df78d22ad5afb42ea5c72ba17bef8395.tar.gz samba-05ac2de0df78d22ad5afb42ea5c72ba17bef8395.tar.bz2 samba-05ac2de0df78d22ad5afb42ea5c72ba17bef8395.zip |
r12051: Merge across the lookup_name and lookup_sid work. Lets see how the build farm
reacts :-)
Volker
(This used to be commit 9f99d04a54588cd9d1a1ab163ebb304437f932f7)
Diffstat (limited to 'source3/groupdb')
-rw-r--r-- | source3/groupdb/mapping.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c index 1e8586786c..14040e4f52 100644 --- a/source3/groupdb/mapping.c +++ b/source3/groupdb/mapping.c @@ -1166,11 +1166,22 @@ NTSTATUS pdb_default_create_alias(struct pdb_methods *methods, enum SID_NAME_USE type; uint32 new_rid; gid_t gid; - + BOOL exists; GROUP_MAP map; - if (lookup_name(get_global_sam_name(), name, &sid, &type)) + TALLOC_CTX *mem_ctx = talloc_new(NULL); + + if (mem_ctx == NULL) { + return NT_STATUS_NO_MEMORY; + } + + exists = lookup_name(mem_ctx, name, LOOKUP_NAME_ISOLATED, + NULL, NULL, &sid, &type); + talloc_free(mem_ctx); + + if (exists) { return NT_STATUS_ALIAS_EXISTS; + } if (!winbind_allocate_rid_and_gid(&new_rid, &gid)) return NT_STATUS_ACCESS_DENIED; |