diff options
author | Volker Lendecke <vl@samba.org> | 2011-03-08 20:59:59 +0100 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2011-03-08 21:51:58 +0100 |
commit | c4b52fbc46cf8b67d1f3ed547d370368679625c1 (patch) | |
tree | 90ab7400187fddd8ff9cc6770aec23b5b9c761e0 | |
parent | a3ef79b6cf1abe4e99e1c1f6903892da23ca11e4 (diff) | |
download | samba-c4b52fbc46cf8b67d1f3ed547d370368679625c1.tar.gz samba-c4b52fbc46cf8b67d1f3ed547d370368679625c1.tar.bz2 samba-c4b52fbc46cf8b67d1f3ed547d370368679625c1.zip |
s3: Use talloc_tos() in idmap_nss_sids_to_unixids
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Mar 8 21:51:58 CET 2011 on sn-devel-104
-rw-r--r-- | source3/winbindd/idmap_nss.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/source3/winbindd/idmap_nss.c b/source3/winbindd/idmap_nss.c index a4ef61b37c..bfef7bb399 100644 --- a/source3/winbindd/idmap_nss.c +++ b/source3/winbindd/idmap_nss.c @@ -124,7 +124,6 @@ static NTSTATUS idmap_nss_unixids_to_sids(struct idmap_domain *dom, struct id_ma static NTSTATUS idmap_nss_sids_to_unixids(struct idmap_domain *dom, struct id_map **ids) { - TALLOC_CTX *ctx; int i; /* initialize the status to avoid suprise */ @@ -132,22 +131,17 @@ static NTSTATUS idmap_nss_sids_to_unixids(struct idmap_domain *dom, struct id_ma ids[i]->status = ID_UNKNOWN; } - ctx = talloc_new(dom); - if ( ! ctx) { - DEBUG(0, ("Out of memory!\n")); - return NT_STATUS_NO_MEMORY; - } - for (i = 0; ids[i]; i++) { struct group *gr; enum lsa_SidType type; - const char *name = NULL; + char *name = NULL; bool ret; /* by default calls to winbindd are disabled the following call will not recurse so this is safe */ (void)winbind_on(); - ret = winbind_lookup_sid(ctx, ids[i]->sid, NULL, &name, &type); + ret = winbind_lookup_sid(talloc_tos(), ids[i]->sid, NULL, + (const char **)&name, &type); (void)winbind_off(); if (!ret) { @@ -189,9 +183,8 @@ static NTSTATUS idmap_nss_sids_to_unixids(struct idmap_domain *dom, struct id_ma ids[i]->status = ID_UNKNOWN; break; } + TALLOC_FREE(name); } - - talloc_free(ctx); return NT_STATUS_OK; } |