s4:repl_meta_data LDB module - remove the current partition control unless it was...
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Sat, 5 Mar 2011 19:38:14 +0000 (20:38 +0100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Thu, 10 Mar 2011 10:12:05 +0000 (11:12 +0100)
source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index 6fd6d7fa14e9668cf18b7e072a48fabe3eb755d4..fb87fd3265786e04bf7b1bcf4ac696c683fd55cb 100644 (file)
@@ -374,8 +374,16 @@ static int replmd_op_callback(struct ldb_request *req, struct ldb_reply *ares)
 
        partition_ctrl = ldb_reply_get_control(ares, DSDB_CONTROL_CURRENT_PARTITION_OID);
 
-       /* Remove the 'partition' control from what we pass up the chain */
-       controls = ldb_controls_except_specified(ares->controls, ares, partition_ctrl);
+       controls = ares->controls;
+       if (ldb_request_get_control(ac->req,
+                                   DSDB_CONTROL_CURRENT_PARTITION_OID) == NULL) {
+               /*
+                * Remove the current partition control from what we pass up
+                * the chain if it hasn't been requested manually.
+                */
+               controls = ldb_controls_except_specified(ares->controls, ares,
+                                                        partition_ctrl);
+       }
 
        if (ares->error != LDB_SUCCESS) {
                DEBUG(0,("%s failure. Error is: %s\n", __FUNCTION__, ldb_strerror(ares->error)));