From c046f2e7a35e2cef2c1482f7d6a3f16be45b49d4 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 15 Nov 2006 16:09:36 +0000 Subject: r19720: - don't pass a pointer reference to ldb_search_default_callback() as it's ugly when it free's the callers memory on failure! - only steal the controls on a LDB_REPLY_EXTENDED, LDB_REPLY_DONE and ignore them on LDB_REPLY_ENTRY, LDB_REPLY_REFERRAL as we currently have not way to return them in a ldb_result (we should fix this!) metze (This used to be commit 47da62b15abf48f97ce6fc8dc4627792728349ae) --- source4/lib/ldb/nssldb/ldb-nss.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source4/lib/ldb/nssldb') diff --git a/source4/lib/ldb/nssldb/ldb-nss.c b/source4/lib/ldb/nssldb/ldb-nss.c index 3206f38a10..614f6e170f 100644 --- a/source4/lib/ldb/nssldb/ldb-nss.c +++ b/source4/lib/ldb/nssldb/ldb-nss.c @@ -336,7 +336,7 @@ done: #define _LDB_NSS_ALLOC_CHECK(mem) do { if (!mem) { errno = ENOMEM; return NSS_STATUS_UNAVAIL; } } while(0) -NSS_STATUS _ldb_nss_group_request(struct ldb_result **res, +NSS_STATUS _ldb_nss_group_request(struct ldb_result **_res, struct ldb_dn *group_dn, const char * const *attrs, const char *mattr) @@ -346,8 +346,9 @@ NSS_STATUS _ldb_nss_group_request(struct ldb_result **res, struct ldb_asq_control *asqc; struct ldb_request *req; int ret; + struct ldb_result *res = *_res; - ctrls = talloc_array(*res, struct ldb_control *, 2); + ctrls = talloc_array(res, struct ldb_control *, 2); _LDB_NSS_ALLOC_CHECK(ctrls); ctrl = talloc(ctrls, struct ldb_control); @@ -370,7 +371,7 @@ NSS_STATUS _ldb_nss_group_request(struct ldb_result **res, ret = ldb_build_search_req( &req, _ldb_nss_ctx->ldb, - *res, + res, group_dn, LDB_SCOPE_BASE, "(objectClass=*)", -- cgit