summaryrefslogtreecommitdiff
path: root/source4/dsdb/common/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/dsdb/common/util.c')
-rw-r--r--source4/dsdb/common/util.c88
1 files changed, 0 insertions, 88 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 9c2950994c..b469b06232 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -2585,94 +2585,6 @@ int dsdb_load_partition_usn(struct ldb_context *ldb, struct ldb_dn *dn,
return LDB_SUCCESS;
}
-/*
- save uSNHighest and uSNUrgent attributes in the @REPLCHANGED object for a
- partition
- */
-int dsdb_save_partition_usn(struct ldb_context *ldb, struct ldb_dn *dn,
- uint64_t uSN, uint64_t urgent_uSN)
-{
- struct ldb_request *req;
- struct ldb_message *msg;
- struct dsdb_control_current_partition *p_ctrl;
- int ret;
-
- msg = ldb_msg_new(ldb);
- if (msg == NULL) {
- return LDB_ERR_OPERATIONS_ERROR;
- }
-
- msg->dn = ldb_dn_new(msg, ldb, "@REPLCHANGED");
- if (msg->dn == NULL) {
- talloc_free(msg);
- return LDB_ERR_OPERATIONS_ERROR;
- }
-
- ret = ldb_msg_add_fmt(msg, "uSNHighest", "%llu", (unsigned long long)uSN);
- if (ret != LDB_SUCCESS) {
- talloc_free(msg);
- return ret;
- }
- msg->elements[0].flags = LDB_FLAG_MOD_REPLACE;
-
- /* urgent_uSN is optional so may not be stored */
- if (urgent_uSN) {
- ret = ldb_msg_add_fmt(msg, "uSNUrgent", "%llu", (unsigned long long)urgent_uSN);
- if (ret != LDB_SUCCESS) {
- talloc_free(msg);
- return ret;
- }
- msg->elements[1].flags = LDB_FLAG_MOD_REPLACE;
- }
-
-
- p_ctrl = talloc(msg, struct dsdb_control_current_partition);
- if (p_ctrl == NULL) {
- talloc_free(msg);
- return LDB_ERR_OPERATIONS_ERROR;
- }
- p_ctrl->version = DSDB_CONTROL_CURRENT_PARTITION_VERSION;
- p_ctrl->dn = dn;
-
- ret = ldb_build_mod_req(&req, ldb, msg,
- msg,
- NULL,
- NULL, ldb_op_default_callback,
- NULL);
-again:
- if (ret != LDB_SUCCESS) {
- talloc_free(msg);
- return ret;
- }
-
- ret = ldb_request_add_control(req,
- DSDB_CONTROL_CURRENT_PARTITION_OID,
- false, p_ctrl);
- if (ret != LDB_SUCCESS) {
- talloc_free(msg);
- return ret;
- }
-
- /* Run the new request */
- ret = ldb_request(ldb, req);
-
- if (ret == LDB_SUCCESS) {
- ret = ldb_wait(req->handle, LDB_WAIT_ALL);
- }
- if (ret == LDB_ERR_NO_SUCH_OBJECT) {
- ret = ldb_build_add_req(&req, ldb, msg,
- msg,
- NULL,
- NULL, ldb_op_default_callback,
- NULL);
- goto again;
- }
-
- talloc_free(msg);
-
- return ret;
-}
-
int drsuapi_DsReplicaCursor2_compare(const struct drsuapi_DsReplicaCursor2 *c1,
const struct drsuapi_DsReplicaCursor2 *c2)
{