s4-samdb: make it possible to ask for the sequence number of a partition
authorAndrew Tridgell <tridge@samba.org>
Sat, 12 Sep 2009 05:24:31 +0000 (15:24 +1000)
committerAndrew Tridgell <tridge@samba.org>
Sat, 12 Sep 2009 05:24:31 +0000 (15:24 +1000)
The partition module normally makes the sequence number extended op
operate across all partitions. It will be useful in the repl task to
be able to ask for the sequence number of one partition

source4/dsdb/samdb/ldb_modules/partition.c

index dec905e0006c166f25686c7e93b5ea6d8a530b73..d4a69952e881122ed085553b302e2a888a844b6c 100644 (file)
@@ -763,6 +763,15 @@ static int partition_sequence_number(struct ldb_module *module, struct ldb_reque
        struct ldb_seqnum_result *tseqr;
        struct ldb_extended *ext;
        struct ldb_result *res;
+       struct dsdb_partition *p;
+
+       p = find_partition(NULL, NULL, req);
+       if (p != NULL) {
+               /* the caller specified what partition they want the
+                * sequence number operation on - just pass it on
+                */
+               return ldb_next_request(p->module, req);                
+       }
 
        seq = talloc_get_type(req->op.extended.data, struct ldb_seqnum_request);