From 05ac2de0df78d22ad5afb42ea5c72ba17bef8395 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 3 Dec 2005 18:34:13 +0000 Subject: r12051: Merge across the lookup_name and lookup_sid work. Lets see how the build farm reacts :-) Volker (This used to be commit 9f99d04a54588cd9d1a1ab163ebb304437f932f7) --- source3/groupdb/mapping.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'source3/groupdb/mapping.c') 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; -- cgit