summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2007-04-15 23:58:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:21 -0500
commit0dd0aab2bc6a5c128f49d46ae9e126e15a54f917 (patch)
tree72b881723129249f77fe1d23f9fe9ba729300276 /source3/nsswitch
parent8b3ea388bce4faf65a3a1722a456f82686863071 (diff)
downloadsamba-0dd0aab2bc6a5c128f49d46ae9e126e15a54f917.tar.gz
samba-0dd0aab2bc6a5c128f49d46ae9e126e15a54f917.tar.bz2
samba-0dd0aab2bc6a5c128f49d46ae9e126e15a54f917.zip
r22230: Let's just cast here, the 2 calls have different allocation mechanisms.
We just let domname and name hang on the mem ctx until the call returns, and the context will be destroyed. Simo. (This used to be commit c38d8396c513d4c418f64b27a9f7c25757388674)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/idmap.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source3/nsswitch/idmap.c b/source3/nsswitch/idmap.c
index dac1eb0521..885950830e 100644
--- a/source3/nsswitch/idmap.c
+++ b/source3/nsswitch/idmap.c
@@ -811,7 +811,7 @@ static NTSTATUS idmap_new_mapping(TALLOC_CTX *ctx, struct id_map *map)
{
NTSTATUS ret;
struct idmap_domain *dom;
- const char *domname, *name;
+ char *domname, *name;
enum lsa_SidType sid_type;
BOOL wbret;
@@ -825,14 +825,16 @@ static NTSTATUS idmap_new_mapping(TALLOC_CTX *ctx, struct id_map *map)
/* by default calls to winbindd are disabled
the following call will not recurse so this is safe */
winbind_on();
- wbret = winbind_lookup_sid(ctx, map->sid, &domname, &name, &sid_type);
+ wbret = winbind_lookup_sid(ctx, map->sid,
+ (const char **)&domname,
+ (const char **)&name,
+ &sid_type);
winbind_off();
} else {
- char *tmp_dom, *tmp_name;
- wbret = winbindd_lookup_name_by_sid(ctx, map->sid, &tmp_dom,
- &tmp_name, &sid_type);
- domname = tmp_dom;
- name = tmp_name;
+ wbret = winbindd_lookup_name_by_sid(ctx, map->sid,
+ &domname,
+ &name,
+ &sid_type);
}
/* check if this is a valid SID and then map it */