From 25e973d5db9ffa6d4138cdbe7c3dd1880149ad2a Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Thu, 5 Aug 2010 21:58:57 +0200 Subject: s4:dsdb/common/util.c - add a function "dsdb_add" --- source4/dsdb/common/util.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'source4/dsdb/common') diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index b8d72781f6..52ba81d975 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -3527,6 +3527,36 @@ int dsdb_request_add_controls(struct ldb_request *req, uint32_t dsdb_flags) return LDB_SUCCESS; } +/* + an add with a set of controls +*/ +int dsdb_add(struct ldb_context *ldb, const struct ldb_message *message, + uint32_t dsdb_flags) +{ + struct ldb_request *req; + int ret; + + ret = ldb_build_add_req(&req, ldb, ldb, + message, + NULL, + NULL, + ldb_op_default_callback, + NULL); + + if (ret != LDB_SUCCESS) return ret; + + ret = dsdb_request_add_controls(req, dsdb_flags); + if (ret != LDB_SUCCESS) { + talloc_free(req); + return ret; + } + + ret = dsdb_autotransaction_request(ldb, req); + + talloc_free(req); + return ret; +} + /* a modify with a set of controls */ -- cgit