summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2011-11-14 13:52:34 +1100
committerAmitay Isaacs <amitay@gmail.com>2011-11-29 16:00:35 +1100
commit422fcbbe7244a0c14aeca5cda7f2a28e2ee821b5 (patch)
treea70acd337528106d38763b0e0df5ca00cbb92c75
parentc199b35dd46b2de21d89ed93edb9a815035717fc (diff)
downloadsamba-422fcbbe7244a0c14aeca5cda7f2a28e2ee821b5.tar.gz
samba-422fcbbe7244a0c14aeca5cda7f2a28e2ee821b5.tar.bz2
samba-422fcbbe7244a0c14aeca5cda7f2a28e2ee821b5.zip
s4-dsdb: Return ldb_result context in dsdb_module_extended
The result of the extended operation is now available in the calling routine. Signed-off-by: Andrew Tridgell <tridge@samba.org>
-rw-r--r--source4/dsdb/samdb/ldb_modules/util.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/util.c b/source4/dsdb/samdb/ldb_modules/util.c
index cee9ac0d00..4e0001d17b 100644
--- a/source4/dsdb/samdb/ldb_modules/util.c
+++ b/source4/dsdb/samdb/ldb_modules/util.c
@@ -314,14 +314,21 @@ int dsdb_module_guid_by_dn(struct ldb_module *module, struct ldb_dn *dn, struct
talloc_free(tmp_ctx);
return LDB_SUCCESS;
}
+
+
/*
a ldb_extended request operating on modules below the
current module
+
+ Note that this does not automatically start a transaction. If you
+ need a transaction the caller needs to start it as needed.
*/
int dsdb_module_extended(struct ldb_module *module,
- const char* oid, void* data,
- uint32_t dsdb_flags,
- struct ldb_request *parent)
+ TALLOC_CTX *mem_ctx,
+ struct ldb_result **_res,
+ const char* oid, void* data,
+ uint32_t dsdb_flags,
+ struct ldb_request *parent)
{
struct ldb_request *req;
int ret;
@@ -329,6 +336,10 @@ int dsdb_module_extended(struct ldb_module *module,
TALLOC_CTX *tmp_ctx = talloc_new(module);
struct ldb_result *res;
+ if (_res != NULL) {
+ (*_res) = NULL;
+ }
+
res = talloc_zero(tmp_ctx, struct ldb_result);
if (!res) {
talloc_free(tmp_ctx);
@@ -373,9 +384,15 @@ int dsdb_module_extended(struct ldb_module *module,
ret = ldb_wait(req->handle, LDB_WAIT_ALL);
}
+ if (_res != NULL && ret == LDB_SUCCESS) {
+ (*_res) = talloc_steal(mem_ctx, res);
+ }
+
talloc_free(tmp_ctx);
return ret;
}
+
+
/*
a ldb_modify request operating on modules below the
current module