s4:dsdb - remove "samdb_msg_add_value"
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Thu, 14 Oct 2010 19:54:51 +0000 (21:54 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 15 Oct 2010 00:21:53 +0000 (00:21 +0000)
This can be substituted by "ldb_msg_add_value".

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Oct 15 00:21:53 UTC 2010 on sn-devel-104

source4/dsdb/common/util.c
source4/rpc_server/lsa/dcesrv_lsa.c

index 1b732c2a338c6318ed850733f8e9da3031e5b8f7..18a8669f29bffd46827931edca5b4e30d3d04944 100644 (file)
@@ -1026,14 +1026,6 @@ int samdb_msg_add_parameters(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, s
        val.data = (uint8_t *)parameters->array;
        return ldb_msg_add_value(msg, attr_name, &val, NULL);
 }
-/*
-  add a general value element to a message
-*/
-int samdb_msg_add_value(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg,
-                             const char *attr_name, const struct ldb_val *val)
-{
-       return ldb_msg_add_value(msg, attr_name, val, NULL);
-}
 
 /*
   sets a general value element to a message
@@ -2094,8 +2086,8 @@ NTSTATUS samdb_set_password(struct ldb_context *ldb, TALLOC_CTX *mem_ctx,
        if ((new_password != NULL)
                        && ((lmNewHash == NULL) && (ntNewHash == NULL))) {
                /* we have the password as plaintext UTF16 */
-               CHECK_RET(samdb_msg_add_value(ldb, mem_ctx, msg,
-                       "clearTextPassword", new_password));
+               CHECK_RET(ldb_msg_add_value(msg, "clearTextPassword",
+                                           new_password, NULL));
                el = ldb_msg_find_element(msg, "clearTextPassword");
                el->flags = LDB_FLAG_MOD_REPLACE;
        } else if ((new_password == NULL)
index ac048ee63b13176a241bb21dd76061af01916e9a..1adfc08f6daf88394e4716d94f2ed2358e7dc8d8 100644 (file)
@@ -3139,8 +3139,7 @@ static NTSTATUS dcesrv_lsa_SetSecret(struct dcesrv_call_state *dce_call, TALLOC_
                val.length = secret.length;
                
                /* set value */
-               if (samdb_msg_add_value(secret_state->sam_ldb, 
-                                       mem_ctx, msg, "priorValue", &val) != LDB_SUCCESS) {
+               if (ldb_msg_add_value(msg, "priorValue", &val, NULL) != LDB_SUCCESS) {
                        return NT_STATUS_NO_MEMORY; 
                }
                
@@ -3180,9 +3179,8 @@ static NTSTATUS dcesrv_lsa_SetSecret(struct dcesrv_call_state *dce_call, TALLOC_
                
                if (old_val) {
                        /* set old value */
-                       if (samdb_msg_add_value(secret_state->sam_ldb, 
-                                               mem_ctx, msg, "priorValue", 
-                                               old_val) != 0) {
+                       if (ldb_msg_add_value(msg, "priorValue",
+                                             old_val, NULL) != LDB_SUCCESS) {
                                return NT_STATUS_NO_MEMORY; 
                        }
                } else {
@@ -3221,8 +3219,7 @@ static NTSTATUS dcesrv_lsa_SetSecret(struct dcesrv_call_state *dce_call, TALLOC_
                val.length = secret.length;
                
                /* set value */
-               if (samdb_msg_add_value(secret_state->sam_ldb, 
-                                       mem_ctx, msg, "currentValue", &val) != LDB_SUCCESS) {
+               if (ldb_msg_add_value(msg, "currentValue", &val, NULL) != LDB_SUCCESS) {
                        return NT_STATUS_NO_MEMORY; 
                }