1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-30 19:42:05 +03:00

python/samdb: adapt search filter for group object type

Use a group search filter which is similar to the filter which is used
by the basic MS Windows group membership management.

The filter excludes the group type GROUP_TYPE_BUILTIN_LOCAL_GROUP.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Björn Baumbach
2019-08-09 16:45:51 +02:00
committed by Stefan Metzmacher
parent 45abb4fd4f
commit c4e899d6b4

View File

@ -258,7 +258,9 @@ pwdLastSet: 0
filter += ('(&(sAMAccountName=%s)(samAccountType=%d))' %
(ldb.binary_encode(member), dsdb.ATYPE_NORMAL_ACCOUNT))
if 'group' in member_types:
filter += ('(&(sAMAccountName=%s)(objectclass=group))' %
filter += ('(&(sAMAccountName=%s)'
'(objectClass=group)'
'(!(groupType:1.2.840.113556.1.4.803:=1)))' %
ldb.binary_encode(member))
if 'computer' in member_types:
samaccountname = member