summaryrefslogtreecommitdiff
path: root/source3/passdb/lookup_sid.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2011-09-26 17:55:47 -0400
committerGünther Deschner <gd@samba.org>2011-10-12 19:28:12 +0200
commit995d1567265be178b4e45f79ea4562a7041ffa52 (patch)
tree97eed8a77f5332f0aa73109454037e6f87250cdb /source3/passdb/lookup_sid.c
parentfc320551d84508371ab1c082752515d538648f49 (diff)
downloadsamba-995d1567265be178b4e45f79ea4562a7041ffa52.tar.gz
samba-995d1567265be178b4e45f79ea4562a7041ffa52.tar.bz2
samba-995d1567265be178b4e45f79ea4562a7041ffa52.zip
s3-group-mapping: Remove fstrings from GROUP_MAP.
Signed-off-by: Andreas Schneider <asn@samba.org> Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Wed Oct 12 19:28:12 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3/passdb/lookup_sid.c')
-rw-r--r--source3/passdb/lookup_sid.c12
1 files changed, 9 insertions, 3 deletions
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;
}