From: Jennifer Sutton Date: Mon, 13 Jan 2025 23:06:07 +0000 (+1300) Subject: python: Make use of OID comparator constants X-Git-Tag: tevent-0.17.0~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7cfdcd299b13710e579e8b2ce7c62baca7623dc;p=thirdparty%2Fsamba.git python: Make use of OID comparator constants Signed-off-by: Jennifer Sutton Reviewed-by: Douglas Bagnall --- diff --git a/python/samba/samdb.py b/python/samba/samdb.py index 18297dc7cb3..ab3d40d70aa 100644 --- a/python/samba/samdb.py +++ b/python/samba/samdb.py @@ -338,7 +338,7 @@ lockoutTime: 0 if 'group' in member_types: filter += ('(&(sAMAccountName=%s)' '(objectClass=group)' - '(!(groupType:1.2.840.113556.1.4.803:=1)))' % + f'(!(groupType:{ldb.OID_COMPARATOR_AND}:=1)))' % ldb.binary_encode(member)) if 'computer' in member_types: samaccountname = member diff --git a/python/samba/schema.py b/python/samba/schema.py index 094ce87405c..123408f467f 100644 --- a/python/samba/schema.py +++ b/python/samba/schema.py @@ -30,7 +30,7 @@ from samba.ndr import ndr_pack from samba.samdb import SamDB from samba.common import get_string from samba import dsdb -from ldb import SCOPE_SUBTREE, SCOPE_ONELEVEL +from ldb import OID_COMPARATOR_AND, SCOPE_SUBTREE, SCOPE_ONELEVEL def get_schema_descriptor(domain_sid, name_map=None): @@ -213,7 +213,7 @@ def get_linked_attributes(schemadn, schemaldb): attrs = ["linkID", "lDAPDisplayName"] res = schemaldb.search( expression="(&(linkID=*)" - "(!(linkID:1.2.840.113556.1.4.803:=1))" + f"(!(linkID:{OID_COMPARATOR_AND}:=1))" "(objectclass=attributeSchema)" "(attributeSyntax=2.5.5.1))", base=schemadn, scope=SCOPE_ONELEVEL, attrs=attrs)