From c807911bf7f6906b3f89633cc7359ecff3fecb23 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Wed, 23 Feb 2011 10:13:56 +0100 Subject: s4:dsdb/common/util.c - fully remove "samdb_msg_add_string" This isn't needed anymore and will be substituted by "ldb_msg_add_string". Signed-off-by: Andrew Bartlett --- source4/dsdb/common/util.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'source4') diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 7527f355b7..f87ed871c0 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -702,7 +702,7 @@ struct ldb_message_element *samdb_find_attribute(struct ldb_context *ldb, int samdb_find_or_add_value(struct ldb_context *ldb, struct ldb_message *msg, const char *name, const char *set_value) { if (samdb_find_attribute(ldb, msg, name, set_value) == NULL) { - return samdb_msg_add_string(ldb, msg, msg, name, set_value); + return ldb_msg_add_string(msg, name, set_value); } return LDB_SUCCESS; } @@ -716,22 +716,7 @@ int samdb_find_or_add_attribute(struct ldb_context *ldb, struct ldb_message *msg return LDB_SUCCESS; } - return samdb_msg_add_string(ldb, msg, msg, name, set_value); -} - - - -/* - add a string element to a message -*/ -int samdb_msg_add_string(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg, - const char *attr_name, const char *str) -{ - const char *s = talloc_strdup(mem_ctx, str); - if (s == NULL) { - return ldb_oom(sam_ldb); - } - return ldb_msg_add_string(msg, attr_name, s); + return ldb_msg_add_string(msg, name, set_value); } /* @@ -1034,7 +1019,7 @@ int samdb_msg_set_string(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struc if (el) { el->num_values = 0; } - return samdb_msg_add_string(sam_ldb, mem_ctx, msg, attr_name, str); + return ldb_msg_add_string(msg, attr_name, str); } /* -- cgit