summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-05-29 01:30:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:41 -0500
commit3a4d7eb2c08a06fac89c34d132f1c32751ce7ad5 (patch)
tree7d34281bba70aaa79d7527b823f00f625836dc3a /source4/dsdb
parent0bd3636a1249dd55f7595c06892e2db65af18bfc (diff)
downloadsamba-3a4d7eb2c08a06fac89c34d132f1c32751ce7ad5.tar.gz
samba-3a4d7eb2c08a06fac89c34d132f1c32751ce7ad5.tar.bz2
samba-3a4d7eb2c08a06fac89c34d132f1c32751ce7ad5.zip
r15927: Optimize ldb module traverse while keeping the API intact.
I was sick of jumping inot each module for each request, even the ones not handle by that module. (This used to be commit 7d65105e885a28584e8555453b90232c43a92bf7)
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/extended_dn.c14
-rw-r--r--source4/dsdb/samdb/ldb_modules/kludge_acl.c12
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectguid.c4
-rw-r--r--source4/dsdb/samdb/ldb_modules/password_hash.c8
-rw-r--r--source4/dsdb/samdb/ldb_modules/rootdse.c4
-rw-r--r--source4/dsdb/samdb/ldb_modules/samldb.c4
6 files changed, 20 insertions, 26 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn.c b/source4/dsdb/samdb/ldb_modules/extended_dn.c
index e421f7d13c..520ffde32d 100644
--- a/source4/dsdb/samdb/ldb_modules/extended_dn.c
+++ b/source4/dsdb/samdb/ldb_modules/extended_dn.c
@@ -290,8 +290,9 @@ error:
return LDB_ERR_OPERATIONS_ERROR;
}
-static int extended_search_async(struct ldb_module *module, struct ldb_control *control, struct ldb_request *req)
+static int extended_search_async(struct ldb_module *module, struct ldb_request *req)
{
+ struct ldb_control *control;
struct ldb_extended_dn_control *extended_ctrl;
struct ldb_control **saved_controls;
struct extended_async_context *ac;
@@ -299,6 +300,13 @@ static int extended_search_async(struct ldb_module *module, struct ldb_control *
char **new_attrs;
int ret;
+ /* check if there's an extended dn control */
+ control = get_control_from_list(req->controls, LDB_CONTROL_EXTENDED_DN_OID);
+ if (control == NULL) {
+ /* not found go on */
+ return ldb_next_request(module, req);
+ }
+
extended_ctrl = talloc_get_type(control->data, struct ldb_extended_dn_control);
if (!extended_ctrl) {
return LDB_ERR_PROTOCOL_ERROR;
@@ -397,9 +405,6 @@ static int extended_request(struct ldb_module *module, struct ldb_request *req)
case LDB_REQ_SEARCH:
return extended_search(module, control, req);
- case LDB_ASYNC_SEARCH:
- return extended_search_async(module, control, req);
-
default:
return LDB_ERR_OPERATIONS_ERROR;
@@ -433,6 +438,7 @@ static int extended_init(struct ldb_module *module)
static const struct ldb_module_ops extended_dn_ops = {
.name = "extended_dn",
+ .search = extended_search_async,
.request = extended_request,
.init_context = extended_init
};
diff --git a/source4/dsdb/samdb/ldb_modules/kludge_acl.c b/source4/dsdb/samdb/ldb_modules/kludge_acl.c
index 88e1831d14..d6929bd732 100644
--- a/source4/dsdb/samdb/ldb_modules/kludge_acl.c
+++ b/source4/dsdb/samdb/ldb_modules/kludge_acl.c
@@ -266,21 +266,14 @@ static int kludge_acl_request(struct ldb_module *module, struct ldb_request *req
switch (req->operation) {
case LDB_REQ_ADD:
- case LDB_ASYNC_ADD:
case LDB_REQ_MODIFY:
- case LDB_ASYNC_MODIFY:
case LDB_REQ_DELETE:
- case LDB_ASYNC_DELETE:
case LDB_REQ_RENAME:
- case LDB_ASYNC_RENAME:
return kludge_acl_change(module, req);
case LDB_REQ_SEARCH:
return kludge_acl_search(module, req);
- case LDB_ASYNC_SEARCH:
- return kludge_acl_search_async(module, req);
-
case LDB_REQ_REGISTER:
return ldb_next_request(module, req);
@@ -354,6 +347,11 @@ done:
static const struct ldb_module_ops kludge_acl_ops = {
.name = "kludge_acl",
+ .search = kludge_acl_search_async,
+ .add = kludge_acl_change,
+ .modify = kludge_acl_change,
+ .del = kludge_acl_change,
+ .rename = kludge_acl_change,
.request = kludge_acl_request,
.start_transaction = kludge_acl_start_trans,
.end_transaction = kludge_acl_end_trans,
diff --git a/source4/dsdb/samdb/ldb_modules/objectguid.c b/source4/dsdb/samdb/ldb_modules/objectguid.c
index 96457447fb..5ac3260339 100644
--- a/source4/dsdb/samdb/ldb_modules/objectguid.c
+++ b/source4/dsdb/samdb/ldb_modules/objectguid.c
@@ -174,9 +174,6 @@ static int objectguid_request(struct ldb_module *module, struct ldb_request *req
case LDB_REQ_ADD:
return objectguid_add(module, req);
- case LDB_ASYNC_ADD:
- return objectguid_add_async(module, req);
-
default:
return ldb_next_request(module, req);
@@ -185,6 +182,7 @@ static int objectguid_request(struct ldb_module *module, struct ldb_request *req
static const struct ldb_module_ops objectguid_ops = {
.name = "objectguid",
+ .add = objectguid_add_async,
.request = objectguid_request
};
diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c
index 67cb01b9d8..0be0fff0ff 100644
--- a/source4/dsdb/samdb/ldb_modules/password_hash.c
+++ b/source4/dsdb/samdb/ldb_modules/password_hash.c
@@ -1842,12 +1842,6 @@ static int password_hash_request(struct ldb_module *module, struct ldb_request *
case LDB_REQ_MODIFY:
return password_hash_modify(module, req);
- case LDB_ASYNC_ADD:
- return password_hash_add_async(module, req);
-
- case LDB_ASYNC_MODIFY:
- return password_hash_modify_async(module, req);
-
default:
return ldb_next_request(module, req);
@@ -1856,6 +1850,8 @@ static int password_hash_request(struct ldb_module *module, struct ldb_request *
static const struct ldb_module_ops password_hash_ops = {
.name = "password_hash",
+ .add = password_hash_add_async,
+ .modify = password_hash_modify_async,
.request = password_hash_request,
.async_wait = password_hash_async_wait
};
diff --git a/source4/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c
index 84622357f8..892a98db12 100644
--- a/source4/dsdb/samdb/ldb_modules/rootdse.c
+++ b/source4/dsdb/samdb/ldb_modules/rootdse.c
@@ -278,9 +278,6 @@ static int rootdse_request(struct ldb_module *module, struct ldb_request *req)
case LDB_REQ_SEARCH:
return rootdse_search_bytree(module, req);
- case LDB_ASYNC_SEARCH:
- return rootdse_search_async(module, req);
-
case LDB_REQ_REGISTER:
return rootdse_register_control(module, req);
@@ -309,6 +306,7 @@ static int rootdse_init(struct ldb_module *module)
static const struct ldb_module_ops rootdse_ops = {
.name = "rootdse",
.init_context = rootdse_init,
+ .search = rootdse_search_async,
.request = rootdse_request
};
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index 9bf322f384..368fd161d4 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -915,9 +915,6 @@ static int samldb_request(struct ldb_module *module, struct ldb_request *req)
case LDB_REQ_ADD:
return samldb_add(module, req);
- case LDB_ASYNC_ADD:
- return samldb_add_async(module, req);
-
default:
return ldb_next_request(module, req);
@@ -933,6 +930,7 @@ static int samldb_init(struct ldb_module *module)
static const struct ldb_module_ops samldb_ops = {
.name = "samldb",
.init_context = samldb_init,
+ .add = samldb_add_async,
.request = samldb_request
};