summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/util.c
diff options
context:
space:
mode:
authorEduardo Lima <eduardoll@gmail.com>2010-03-24 16:21:15 -0300
committerAndrew Tridgell <tridge@samba.org>2010-03-26 16:50:48 +1100
commitaf807758e8d98ea53f58b2bae8f00b83074cfdec (patch)
treee3657a2d8474e760dd6b03d84b521f1f6807a764 /source4/dsdb/samdb/ldb_modules/util.c
parent63fc3978089df403d7e63462593784ff3d05e6e7 (diff)
downloadsamba-af807758e8d98ea53f58b2bae8f00b83074cfdec.tar.gz
samba-af807758e8d98ea53f58b2bae8f00b83074cfdec.tar.bz2
samba-af807758e8d98ea53f58b2bae8f00b83074cfdec.zip
s4-drs: replmd_delete with the 3 stage deletion recycle bin
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/util.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/util.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/util.c b/source4/dsdb/samdb/ldb_modules/util.c
index f8a634379f..7ff5e16fef 100644
--- a/source4/dsdb/samdb/ldb_modules/util.c
+++ b/source4/dsdb/samdb/ldb_modules/util.c
@@ -491,7 +491,6 @@ int dsdb_check_optional_feature(struct ldb_module *module, struct ldb_dn *scope,
return LDB_SUCCESS;
}
-
/*
find a 'reference' DN that points at another object
(eg. serverReference, rIDManagerReference etc)
@@ -802,3 +801,28 @@ bool dsdb_module_am_system(struct ldb_module *module)
= (struct auth_session_info *)ldb_get_opaque(ldb, "sessionInfo");
return security_session_user_level(session_info) == SECURITY_SYSTEM;
}
+
+/*
+ check if the recyclebin is enabled
+ */
+int dsdb_recyclebin_enabled(struct ldb_module *module, bool *enabled)
+{
+ struct ldb_context *ldb = ldb_module_get_ctx(module);
+ struct ldb_dn *partitions_dn;
+ struct GUID recyclebin_guid;
+ int ret;
+
+ partitions_dn = samdb_partitions_dn(ldb, module);
+
+ GUID_from_string(DS_GUID_FEATURE_RECYCLE_BIN, &recyclebin_guid);
+
+ ret = dsdb_check_optional_feature(module, partitions_dn, recyclebin_guid, enabled);
+ if (ret != LDB_SUCCESS) {
+ ldb_asprintf_errstring(ldb, "Could not verify if Recycle Bin is enabled \n");
+ talloc_free(partitions_dn);
+ return LDB_ERR_UNWILLING_TO_PERFORM;
+ }
+
+ talloc_free(partitions_dn);
+ return LDB_SUCCESS;
+}