summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-09-24 12:09:26 -0700
committerAndrew Tridgell <tridge@samba.org>2010-09-25 10:38:45 -0700
commit5568fcd88b2a32ba389694ee35ab521af1ea7394 (patch)
treecd3adc4f80d9064d085225f0f6dfac68ecd2fc39 /source4
parentf4893e7d33b7c9aaafba5ce8657972d3eb600257 (diff)
downloadsamba-5568fcd88b2a32ba389694ee35ab521af1ea7394.tar.gz
samba-5568fcd88b2a32ba389694ee35ab521af1ea7394.tar.bz2
samba-5568fcd88b2a32ba389694ee35ab521af1ea7394.zip
s4-dsdb: added tagging of requests in dsdb modules
this allows you to call dsdb_req_chain_debug() in gdb or when writing debug code to see the request chain
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/ldb_modules/acl.c1
-rw-r--r--source4/dsdb/samdb/ldb_modules/anr.c2
-rw-r--r--source4/dsdb/samdb/ldb_modules/descriptor.c1
-rw-r--r--source4/dsdb/samdb/ldb_modules/extended_dn_in.c2
-rw-r--r--source4/dsdb/samdb/ldb_modules/extended_dn_out.c1
-rw-r--r--source4/dsdb/samdb/ldb_modules/lazy_commit.c6
-rw-r--r--source4/dsdb/samdb/ldb_modules/local_password.c2
-rw-r--r--source4/dsdb/samdb/ldb_modules/util.c15
8 files changed, 30 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/acl.c b/source4/dsdb/samdb/ldb_modules/acl.c
index 826884f811..497e1add5c 100644
--- a/source4/dsdb/samdb/ldb_modules/acl.c
+++ b/source4/dsdb/samdb/ldb_modules/acl.c
@@ -1344,6 +1344,7 @@ static int acl_search(struct ldb_module *module, struct ldb_request *req)
req->controls,
ac, acl_search_callback,
req);
+ LDB_REQ_SET_LOCATION(down_req);
if (ret != LDB_SUCCESS) {
return ret;
}
diff --git a/source4/dsdb/samdb/ldb_modules/anr.c b/source4/dsdb/samdb/ldb_modules/anr.c
index 15a8a7aa48..ebe9d66097 100644
--- a/source4/dsdb/samdb/ldb_modules/anr.c
+++ b/source4/dsdb/samdb/ldb_modules/anr.c
@@ -32,6 +32,7 @@
#include "includes.h"
#include "ldb_module.h"
#include "dsdb/samdb/samdb.h"
+#include "dsdb/samdb/ldb_modules/util.h"
/**
* Make a and 'and' or 'or' tree from the two supplied elements
@@ -355,6 +356,7 @@ static int anr_search(struct ldb_module *module, struct ldb_request *req)
req->controls,
ac, anr_search_callback,
req);
+ LDB_REQ_SET_LOCATION(down_req);
if (ret != LDB_SUCCESS) {
return ldb_operr(ldb);
}
diff --git a/source4/dsdb/samdb/ldb_modules/descriptor.c b/source4/dsdb/samdb/ldb_modules/descriptor.c
index f32383ed72..03e445e73c 100644
--- a/source4/dsdb/samdb/ldb_modules/descriptor.c
+++ b/source4/dsdb/samdb/ldb_modules/descriptor.c
@@ -857,6 +857,7 @@ static int descriptor_search(struct ldb_module *module, struct ldb_request *req)
req->controls,
ac, descriptor_search_callback,
ac->req);
+ LDB_REQ_SET_LOCATION(down_req);
if (ret != LDB_SUCCESS) {
return ret;
}
diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn_in.c b/source4/dsdb/samdb/ldb_modules/extended_dn_in.c
index c4d006fc4f..3dec685678 100644
--- a/source4/dsdb/samdb/ldb_modules/extended_dn_in.c
+++ b/source4/dsdb/samdb/ldb_modules/extended_dn_in.c
@@ -173,6 +173,7 @@ static int extended_base_callback(struct ldb_request *req, struct ldb_reply *are
ac->req->controls,
ac, extended_final_callback,
ac->req);
+ LDB_REQ_SET_LOCATION(down_req);
break;
case LDB_ADD:
{
@@ -191,6 +192,7 @@ static int extended_base_callback(struct ldb_request *req, struct ldb_reply *are
ac->req->controls,
ac, extended_final_callback,
ac->req);
+ LDB_REQ_SET_LOCATION(down_req);
break;
}
case LDB_MODIFY:
diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c
index fc0401369c..2daae253ef 100644
--- a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c
+++ b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c
@@ -643,6 +643,7 @@ static int extended_dn_out_search(struct ldb_module *module, struct ldb_request
req->controls,
ac, callback,
req);
+ LDB_REQ_SET_LOCATION(down_req);
if (ret != LDB_SUCCESS) {
return ret;
}
diff --git a/source4/dsdb/samdb/ldb_modules/lazy_commit.c b/source4/dsdb/samdb/ldb_modules/lazy_commit.c
index 6a59a967aa..b46f88a575 100644
--- a/source4/dsdb/samdb/ldb_modules/lazy_commit.c
+++ b/source4/dsdb/samdb/ldb_modules/lazy_commit.c
@@ -50,6 +50,7 @@ static int unlazy_op(struct ldb_module *module, struct ldb_request *req)
req->controls,
req, dsdb_next_callback,
req);
+ LDB_REQ_SET_LOCATION(new_req);
break;
case LDB_ADD:
ret = ldb_build_add_req(&new_req, ldb_module_get_ctx(module), req,
@@ -57,6 +58,7 @@ static int unlazy_op(struct ldb_module *module, struct ldb_request *req)
req->controls,
req, dsdb_next_callback,
req);
+ LDB_REQ_SET_LOCATION(new_req);
break;
case LDB_MODIFY:
ret = ldb_build_mod_req(&new_req, ldb_module_get_ctx(module), req,
@@ -64,6 +66,7 @@ static int unlazy_op(struct ldb_module *module, struct ldb_request *req)
req->controls,
req, dsdb_next_callback,
req);
+ LDB_REQ_SET_LOCATION(new_req);
break;
case LDB_DELETE:
ret = ldb_build_del_req(&new_req, ldb_module_get_ctx(module), req,
@@ -71,6 +74,7 @@ static int unlazy_op(struct ldb_module *module, struct ldb_request *req)
req->controls,
req, dsdb_next_callback,
req);
+ LDB_REQ_SET_LOCATION(new_req);
break;
case LDB_RENAME:
ret = ldb_build_rename_req(&new_req, ldb_module_get_ctx(module), req,
@@ -79,6 +83,7 @@ static int unlazy_op(struct ldb_module *module, struct ldb_request *req)
req->controls,
req, dsdb_next_callback,
req);
+ LDB_REQ_SET_LOCATION(new_req);
break;
case LDB_EXTENDED:
ret = ldb_build_extended_req(&new_req, ldb_module_get_ctx(module),
@@ -88,6 +93,7 @@ static int unlazy_op(struct ldb_module *module, struct ldb_request *req)
req->controls,
req, dsdb_next_callback,
req);
+ LDB_REQ_SET_LOCATION(new_req);
break;
default:
ldb_set_errstring(ldb_module_get_ctx(module),
diff --git a/source4/dsdb/samdb/ldb_modules/local_password.c b/source4/dsdb/samdb/ldb_modules/local_password.c
index 942b5a2543..022a6dc98d 100644
--- a/source4/dsdb/samdb/ldb_modules/local_password.c
+++ b/source4/dsdb/samdb/ldb_modules/local_password.c
@@ -34,6 +34,7 @@
#include "dsdb/samdb/samdb.h"
#include "librpc/ndr/libndr.h"
#include "dsdb/samdb/ldb_modules/password_modules.h"
+#include "dsdb/samdb/ldb_modules/util.h"
#define PASSWORD_GUID_ATTR "masterGUID"
@@ -1079,6 +1080,7 @@ static int local_password_search(struct ldb_module *module, struct ldb_request *
req->controls,
ac, lpdb_remote_search_callback,
req);
+ LDB_REQ_SET_LOCATION(remote_req);
if (ret != LDB_SUCCESS) {
return ret;
}
diff --git a/source4/dsdb/samdb/ldb_modules/util.c b/source4/dsdb/samdb/ldb_modules/util.c
index a78200133b..03c301898e 100644
--- a/source4/dsdb/samdb/ldb_modules/util.c
+++ b/source4/dsdb/samdb/ldb_modules/util.c
@@ -27,6 +27,7 @@
#include "dsdb/samdb/samdb.h"
#include "util.h"
#include "libcli/security/security.h"
+#include "lib/ldb/include/ldb_private.h"
/*
search for attrs on one DN, in the modules below
@@ -1198,3 +1199,17 @@ bool dsdb_block_anonymous_ops(struct ldb_module *module,
talloc_free(tmp_ctx);
return result;
}
+
+/*
+ show the chain of requests, useful for debugging async requests
+ */
+void dsdb_req_chain_debug(struct ldb_request *req, int level)
+{
+ char *ret;
+ int i=0;
+
+ while (req && req->handle) {
+ DEBUG(level,("req[%u] %p : %s\n", i++, req, ldb_req_location(req)));
+ req = req->handle->parent;
+ }
+}