summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-06-09 16:33:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:09:00 -0500
commitf283307f5222576d6128d7464875982570d254ea (patch)
tree9fa4dbc8b664e25f60529d7a7a5942db94a47b67
parent9469af459651f988dbf095a57bbece68022aa45e (diff)
downloadsamba-f283307f5222576d6128d7464875982570d254ea.tar.gz
samba-f283307f5222576d6128d7464875982570d254ea.tar.bz2
samba-f283307f5222576d6128d7464875982570d254ea.zip
r16125: Add another helpful utility function: samdb_msg_add_int()
Andrew Bartlett (This used to be commit 2fe9de8105843776b8ef41ef6f9a6cea5cb188ff)
-rw-r--r--source4/dsdb/samdb/samdb.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c
index 771a3e5367..1b95fdf970 100644
--- a/source4/dsdb/samdb/samdb.c
+++ b/source4/dsdb/samdb/samdb.c
@@ -761,6 +761,16 @@ int samdb_msg_add_delval(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struc
}
/*
+ add a int element to a message
+*/
+int samdb_msg_add_int(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg,
+ const char *attr_name, int v)
+{
+ const char *s = talloc_asprintf(mem_ctx, "%d", v);
+ return samdb_msg_add_string(sam_ldb, mem_ctx, msg, attr_name, s);
+}
+
+/*
add a uint_t element to a message
*/
int samdb_msg_add_uint(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg,