summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-07-11 02:04:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:10:01 -0500
commitfdbbabe60223062ac72f1853d3c236a1de8ebe0e (patch)
tree24aaf3b2eab4f64b9d52d4507fbf8d2d06aa6fa6
parent2caa112ae4988d4e14e0d34de94da307675777af (diff)
downloadsamba-fdbbabe60223062ac72f1853d3c236a1de8ebe0e.tar.gz
samba-fdbbabe60223062ac72f1853d3c236a1de8ebe0e.tar.bz2
samba-fdbbabe60223062ac72f1853d3c236a1de8ebe0e.zip
r16933: Sort the partitions in order from most, to least specific.
Remember to perform operations on the base database as well. Andrew Bartlett (This used to be commit eae232530c967fe949355cf1914ca0cb8c0ea8c2)
-rw-r--r--source4/dsdb/samdb/ldb_modules/partition.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c
index c7c9aa7cfe..05ba701653 100644
--- a/source4/dsdb/samdb/ldb_modules/partition.c
+++ b/source4/dsdb/samdb/ldb_modules/partition.c
@@ -217,6 +217,11 @@ static int partition_del_trans(struct ldb_module *module)
int i, ret, ret2 = LDB_SUCCESS;
struct partition_private_data *data = talloc_get_type(module->private_data,
struct partition_private_data);
+ ret = ldb_next_del_trans(module);
+ if (ret != LDB_SUCCESS) {
+ ret2 = ret;
+ }
+
/* Look at base DN */
/* Figure out which partition it is under */
/* Skip the lot if 'data' isn't here yet (initialistion) */
@@ -238,6 +243,12 @@ static int partition_sequence_number(struct ldb_module *module, struct ldb_reque
uint64_t seq_number = 0;
struct partition_private_data *data = talloc_get_type(module->private_data,
struct partition_private_data);
+ ret = ldb_next_request(module, req);
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
+ seq_number = seq_number + req->op.seq_num.seq_num;
+
/* Look at base DN */
/* Figure out which partition it is under */
/* Skip the lot if 'data' isn't here yet (initialistion) */
@@ -264,7 +275,7 @@ static int sort_compare(void *void1,
struct partition *partition1 = talloc_get_type(*pp1, struct partition);
struct partition *partition2 = talloc_get_type(*pp2, struct partition);
- return -ldb_dn_compare(ldb, partition1->dn, partition2->dn);
+ return ldb_dn_compare(ldb, partition1->dn, partition2->dn);
}
static int partition_init(struct ldb_module *module)
@@ -359,7 +370,7 @@ static int partition_init(struct ldb_module *module)
}
data->partitions[i] = NULL;
- /* sort these into order */
+ /* sort these into order, most to least specific */
ldb_qsort(data->partitions, partition_attributes->num_values, sizeof(*data->partitions),
module->ldb, sort_compare);