diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-10-16 11:00:12 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-10-16 14:39:23 +0200 |
commit | 42d9978cdd20c4f5a8cfee8e9db8e8d7b405b677 (patch) | |
tree | db957db62227c70b66b3cc7a63facb6b6ab41454 | |
parent | a0bd52975171b1a4d2407026b21df5cfe3d54dce (diff) | |
download | samba-42d9978cdd20c4f5a8cfee8e9db8e8d7b405b677.tar.gz samba-42d9978cdd20c4f5a8cfee8e9db8e8d7b405b677.tar.bz2 samba-42d9978cdd20c4f5a8cfee8e9db8e8d7b405b677.zip |
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.
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/util.c | 74 |
1 files changed, 0 insertions, 74 deletions
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 |