From 42d9978cdd20c4f5a8cfee8e9db8e8d7b405b677 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sat, 16 Oct 2010 11:00:12 +0200 Subject: s4:dsdb/samdb/ldb_modules/util.c - remove now unused functions which set integers Please do always use the functions which specifiy the appropriate integer length to not run into platform-specific issues. Therefore I'm removing these generic calls. --- source4/dsdb/samdb/ldb_modules/util.c | 74 ----------------------------------- 1 file changed, 74 deletions(-) (limited to 'source4/dsdb/samdb/ldb_modules') diff --git a/source4/dsdb/samdb/ldb_modules/util.c b/source4/dsdb/samdb/ldb_modules/util.c index 2380e02ac2..e550630c5d 100644 --- a/source4/dsdb/samdb/ldb_modules/util.c +++ b/source4/dsdb/samdb/ldb_modules/util.c @@ -616,55 +616,6 @@ int dsdb_module_rid_manager_dn(struct ldb_module *module, TALLOC_CTX *mem_ctx, s "rIDManagerReference", dn); } - -/* - update an integer attribute safely via a constrained delete/add - */ -int dsdb_module_constrainted_update_integer(struct ldb_module *module, struct ldb_dn *dn, - const char *attr, uint64_t old_val, uint64_t new_val) -{ - struct ldb_message *msg; - struct ldb_message_element *el; - struct ldb_val v1, v2; - int ret; - char *vstring; - - msg = ldb_msg_new(module); - msg->dn = dn; - - ret = ldb_msg_add_empty(msg, attr, LDB_FLAG_MOD_DELETE, &el); - if (ret != LDB_SUCCESS) { - talloc_free(msg); - return ret; - } - el->num_values = 1; - el->values = &v1; - vstring = talloc_asprintf(msg, "%llu", (unsigned long long)old_val); - if (!vstring) { - talloc_free(msg); - return ldb_module_oom(module); - } - v1 = data_blob_string_const(vstring); - - ret = ldb_msg_add_empty(msg, attr, LDB_FLAG_MOD_ADD, &el); - if (ret != LDB_SUCCESS) { - talloc_free(msg); - return ret; - } - el->num_values = 1; - el->values = &v2; - vstring = talloc_asprintf(msg, "%llu", (unsigned long long)new_val); - if (!vstring) { - talloc_free(msg); - return ldb_module_oom(module); - } - v2 = data_blob_string_const(vstring); - - ret = dsdb_module_modify(module, msg, DSDB_FLAG_NEXT_MODULE); - talloc_free(msg); - return ret; -} - /* used to chain to the callers callback */ @@ -676,31 +627,6 @@ int dsdb_next_callback(struct ldb_request *req, struct ldb_reply *ares) return up_req->callback(up_req, ares); } - -/* - set an integer attribute - */ -int dsdb_module_set_integer(struct ldb_module *module, struct ldb_dn *dn, - const char *attr, uint64_t new_val) -{ - struct ldb_message *msg; - int ret; - - msg = ldb_msg_new(module); - msg->dn = dn; - - ret = ldb_msg_add_fmt(msg, attr, "%llu", (unsigned long long)new_val); - if (ret != LDB_SUCCESS) { - talloc_free(msg); - return ret; - } - msg->elements[0].flags = LDB_FLAG_MOD_REPLACE; - - ret = dsdb_module_modify(module, msg, DSDB_FLAG_NEXT_MODULE); - talloc_free(msg); - return ret; -} - /* load the uSNHighest and the uSNUrgent attributes from the @REPLCHANGED object for a partition -- cgit