summaryrefslogtreecommitdiffstats
path: root/source4/dsdb/common
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-07-14 13:18:17 +1000
committerAndrew Tridgell <tridge@samba.org>2011-07-21 11:44:36 +1000
commit114377a91f3bf823ebd066e36a9bc0d16df4eff2 (patch)
tree3688141990e481e621517a16b1b957fef7978cbb /source4/dsdb/common
parenta36af1a5011dddd5551c768f9bf69188c8775a43 (diff)
downloadsamba-114377a91f3bf823ebd066e36a9bc0d16df4eff2.tar.gz
samba-114377a91f3bf823ebd066e36a9bc0d16df4eff2.tar.xz
samba-114377a91f3bf823ebd066e36a9bc0d16df4eff2.zip
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 <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/common')
-rw-r--r--source4/dsdb/common/util.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 7283405bb36..ae2ca74ea73 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -3723,6 +3723,36 @@ int dsdb_modify(struct ldb_context *ldb, const struct ldb_message *message,
}
/*
+ 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
*/