summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2019-08-09 16:45:51 +0200
committerStefan Metzmacher <metze@samba.org>2020-01-21 14:38:46 +0000
commitc4e899d6b4bcc5d42c73810e0c7fe8b67db2b094 (patch)
treefc1c9c820463a06ba9d1fd46080146102005e50e /python
parent45abb4fd4f42db5e71a6e226f1ed5486f3c257db (diff)
downloadsamba-c4e899d6b4bcc5d42c73810e0c7fe8b67db2b094.tar.gz
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>
Diffstat (limited to 'python')
-rw-r--r--python/samba/samdb.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/samba/samdb.py b/python/samba/samdb.py
index 7852373c817..b1d5acb8399 100644
--- a/python/samba/samdb.py
+++ b/python/samba/samdb.py
@@ -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