]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python: Disable calls to _dsdb_garbage_collect_tombstones without addc
authorDavid Mulder <dmulder@suse.com>
Thu, 3 Dec 2020 17:32:09 +0000 (17:32 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 10 Mar 2021 21:43:34 +0000 (21:43 +0000)
dsdb._dsdb_garbage_collect_tombstones isn't
built without the addc, so ignore calls to it
in samdb.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/samdb.py

index f95709ab7c844a2b1cba09887ffb931e93ab8f28..292bee14da3627e0edbfda1ac6ba9875725d40bd 100644 (file)
@@ -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)