From 0dd0aab2bc6a5c128f49d46ae9e126e15a54f917 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 15 Apr 2007 23:58:39 +0000 Subject: 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) --- source3/nsswitch/idmap.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source3/nsswitch/idmap.c') 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 */ -- cgit