summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-01-17 14:19:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:43:39 -0500
commita35a071fc95823cea74fdd3cb1858df4d7104901 (patch)
treebb3f660050dcf514f25d9af16945302189591eb4 /source4/dsdb
parent7730ff44afea09f8765f8efdb7a4e5ad61f19ff4 (diff)
downloadsamba-a35a071fc95823cea74fdd3cb1858df4d7104901.tar.gz
samba-a35a071fc95823cea74fdd3cb1858df4d7104901.tar.bz2
samba-a35a071fc95823cea74fdd3cb1858df4d7104901.zip
r20849: first step to move away from using find_backend() and use find_partition()
instead metze (This used to be commit 0d75cca6f37975a3855973468dc55520cb3b3fb7)
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/partition.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c
index 8a497411df..5ac954d65b 100644
--- a/source4/dsdb/samdb/ldb_modules/partition.c
+++ b/source4/dsdb/samdb/ldb_modules/partition.c
@@ -138,7 +138,6 @@ static struct ldb_module *find_backend(struct ldb_module *module, struct ldb_req
return make_module_for_next_request(req, module->ldb, partition->module);
};
-
/*
fire the caller's callback for every entry, but only send 'done' once.
*/
@@ -274,6 +273,7 @@ static int partition_send_all(struct ldb_module *module,
static int partition_replicate(struct ldb_module *module, struct ldb_request *req, struct ldb_dn *dn)
{
int i;
+ struct dsdb_control_current_partition *partition;
struct ldb_module *backend;
struct partition_private_data *data = talloc_get_type(module->private_data,
struct partition_private_data);
@@ -293,11 +293,26 @@ static int partition_replicate(struct ldb_module *module, struct ldb_request *re
}
}
- /* Otherwise, we need to find the backend to fire it to */
+ /* Otherwise, we need to find the partition to fire it to */
+
+ /* Find partition */
+ partition = find_partition(data, dn);
+ if (!partition) {
+ /*
+ * if we haven't found a matching partition
+ * pass the request to the main ldb
+ *
+ * TODO: we should maybe return an error here
+ * if it's not a special dn
+ */
+ return ldb_next_request(module, req);
+ }
+
+ backend = make_module_for_next_request(req, module->ldb, partition->module);
+ if (!backend) {
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
- /* Find backend */
- backend = find_backend(module, req, dn);
-
/* issue request */
return ldb_next_request(backend, req);