From e9fcc9d5490140e73b7bc959105d5b085dc18068 Mon Sep 17 00:00:00 2001 From: Lukas Oyen Date: Thu, 3 Aug 2017 18:48:04 +0200 Subject: [PATCH] Bug #45124: adc: fix __get_highestCommittedUSN() --- .../modules/univention/connector/ad/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/univention-ad-connector/modules/univention/connector/ad/__init__.py b/services/univention-ad-connector/modules/univention/connector/ad/__init__.py index 1e36ff5..2fc3cb2 100644 --- a/services/univention-ad-connector/modules/univention/connector/ad/__init__.py +++ b/services/univention-ad-connector/modules/univention/connector/ad/__init__.py @@ -1290,7 +1290,10 @@ class ad(univention.connector.ucs): ''' _d = ud.function('ldap.__get_highestCommittedUSN') try: - usn = self.lo_ad.getAttr('', 'highestCommittedUSN')[0] + # This will search for the `rootDSE` object. `uldap.get{Attr}()` + # are not usable, as they don't permit emtpy DNs. + result = self.lo_ad.lo.search_s('', ldap.SCOPE_BASE, '(objectClass=*)', ['highestCommittedUSN']) + usn = result[0][1]['highestCommittedUSN'][0] return int(usn) except Exception: self._debug_traceback(ud.ERROR, "search for highestCommittedUSN failed") -- 2.7.4