summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-10-21 15:21:21 +1100
committerAndrew Bartlett <abartlet@samba.org>2009-10-21 22:43:56 +1100
commit398188fb9b0d81552d0eb3dba9fcf0695ea539ff (patch)
treeaf1566a937751caaf4110c6cd44e27d15d43b896 /source4/dsdb/samdb/ldb_modules/repl_meta_data.c
parentbd53628c7a7d430878588666372dc73f1a88b7de (diff)
downloadsamba-398188fb9b0d81552d0eb3dba9fcf0695ea539ff.tar.gz
samba-398188fb9b0d81552d0eb3dba9fcf0695ea539ff.tar.bz2
samba-398188fb9b0d81552d0eb3dba9fcf0695ea539ff.zip
s4:dsdb Remove potentially confusing 'partition' control from result
This ensures that the partition control, needed here for repl_meta_data's internal work, is not pushed up to other callers. Andrew Bartlett
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/repl_meta_data.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/repl_meta_data.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 90ff238aa2..00f3856857 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -123,8 +123,15 @@ static int replmd_op_callback(struct ldb_request *req, struct ldb_reply *ares)
struct ldb_control *partition_ctrl;
const struct dsdb_control_current_partition *partition;
+ struct ldb_control **controls;
+
+ partition_ctrl = ldb_reply_get_control(ares, DSDB_CONTROL_CURRENT_PARTITION_OID);
+
+ /* Remove the 'partition' control from what we pass up the chain */
+ controls = controls_except_specified(ares->controls, ares, partition_ctrl);
+
if (ares->error != LDB_SUCCESS) {
- return ldb_module_done(ac->req, ares->controls,
+ return ldb_module_done(ac->req, controls,
ares->response, ares->error);
}
@@ -134,11 +141,11 @@ static int replmd_op_callback(struct ldb_request *req, struct ldb_reply *ares)
NULL, LDB_ERR_OPERATIONS_ERROR);
}
- partition_ctrl = ldb_reply_get_control(ares, DSDB_CONTROL_CURRENT_PARTITION_OID);
if (!partition_ctrl) {
return ldb_module_done(ac->req, NULL,
NULL, LDB_ERR_OPERATIONS_ERROR);
}
+
partition = talloc_get_type_abort(partition_ctrl->data,
struct dsdb_control_current_partition);
@@ -181,7 +188,12 @@ static int replmd_op_callback(struct ldb_request *req, struct ldb_reply *ares)
}
return ret;
} else {
- return ldb_module_done(ac->req, ares->controls,
+ /* free the partition control container here, for the
+ * common path. Other cases will have it cleaned up
+ * eventually with the ares */
+ talloc_free(partition_ctrl);
+ return ldb_module_done(ac->req,
+ controls_except_specified(controls, ares, partition_ctrl),
ares->response, LDB_SUCCESS);
}
}