From: David Mulder Date: Thu, 3 Dec 2020 17:32:09 +0000 (+0000) Subject: python: Disable calls to _dsdb_garbage_collect_tombstones without addc X-Git-Tag: tevent-0.11.0~1601 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b659ec940c7515bc46e3f984be7554cdcdf840a0;p=thirdparty%2Fsamba.git python: Disable calls to _dsdb_garbage_collect_tombstones without addc dsdb._dsdb_garbage_collect_tombstones isn't built without the addc, so ignore calls to it in samdb. Signed-off-by: David Mulder Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/samdb.py b/python/samba/samdb.py index f95709ab7c8..292bee14da3 100644 --- a/python/samba/samdb.py +++ b/python/samba/samdb.py @@ -34,6 +34,7 @@ from samba.dcerpc import drsblobs, misc from samba.common import normalise_int32 from samba.common import get_bytes, cmp from samba.dcerpc import security +from samba import is_ad_dc_built import binascii __docformat__ = "restructuredText" @@ -1369,6 +1370,10 @@ schemaUpdateNow: 1 '''garbage_collect_tombstones(lp, samdb, [dn], current_time, tombstone_lifetime) -> (num_objects_expunged, num_links_expunged)''' + if not is_ad_dc_built(): + raise SamDBError('Cannot garbage collect tombstones: ' \ + 'AD DC was not built') + if tombstone_lifetime is None: return dsdb._dsdb_garbage_collect_tombstones(self, dn, current_time)