From 995d1567265be178b4e45f79ea4562a7041ffa52 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 26 Sep 2011 17:55:47 -0400 Subject: s3-group-mapping: Remove fstrings from GROUP_MAP. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas Schneider Autobuild-User: Günther Deschner Autobuild-Date: Wed Oct 12 19:28:12 CEST 2011 on sn-devel-104 --- source3/passdb/lookup_sid.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source3/passdb/lookup_sid.c') diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c index 4c2e73befd..a02c941d8e 100644 --- a/source3/passdb/lookup_sid.c +++ b/source3/passdb/lookup_sid.c @@ -1233,20 +1233,25 @@ done: static bool legacy_sid_to_gid(const struct dom_sid *psid, gid_t *pgid) { - GROUP_MAP map; + GROUP_MAP *map; union unid_t id; enum lsa_SidType type; + map = talloc_zero(NULL, GROUP_MAP); + if (!map) { + return false; + } + if ((sid_check_is_in_builtin(psid) || sid_check_is_in_wellknown_domain(psid))) { bool ret; become_root(); - ret = pdb_getgrsid(&map, *psid); + ret = pdb_getgrsid(map, *psid); unbecome_root(); if (ret) { - *pgid = map.gid; + *pgid = map->gid; goto done; } DEBUG(10,("LEGACY: mapping failed for sid %s\n", @@ -1286,6 +1291,7 @@ static bool legacy_sid_to_gid(const struct dom_sid *psid, gid_t *pgid) store_gid_sid_cache(psid, *pgid); + TALLOC_FREE(map); return true; } -- cgit