From 114377a91f3bf823ebd066e36a9bc0d16df4eff2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 14 Jul 2011 13:18:17 +1000 Subject: s4-dsdb: added dsdb_delete() function this gives us a delete function that takes the standard set of dsdb flags Pair-Programmed-With: Andrew Bartlett --- source4/dsdb/common/util.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 7283405bb3..ae2ca74ea7 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -3722,6 +3722,36 @@ int dsdb_modify(struct ldb_context *ldb, const struct ldb_message *message, return ret; } +/* + a delete with a set of flags +*/ +int dsdb_delete(struct ldb_context *ldb, const struct ldb_dn *dn, + uint32_t dsdb_flags) +{ + struct ldb_request *req; + int ret; + + ret = ldb_build_del_req(&req, ldb, ldb, + dn, + 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; +} + /* like dsdb_modify() but set all the element flags to LDB_FLAG_MOD_REPLACE -- cgit