summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2019-12-30 13:57:11 +0100
committerStefan Metzmacher <metze@samba.org>2020-01-21 14:38:46 +0000
commitf9bf6b7856ee573d4f9f1bd0748ac46d24798d5c (patch)
treec6bfcbafd678fa504790071ac4aaf5c4f192f76c /python
parentc4e899d6b4bcc5d42c73810e0c7fe8b67db2b094 (diff)
downloadsamba-f9bf6b7856ee573d4f9f1bd0748ac46d24798d5c.tar.gz
python/samdb: add type "all" to search for all common types of group members
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.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/python/samba/samdb.py b/python/samba/samdb.py
index b1d5acb8399..4606b607323 100644
--- a/python/samba/samdb.py
+++ b/python/samba/samdb.py
@@ -254,6 +254,16 @@ pwdLastSet: 0
def group_member_filter(self, member, member_types):
filter = ""
+ all_member_types = [ 'user',
+ 'group',
+ 'computer',
+ 'serviceaccount',
+ 'contact',
+ ]
+
+ if 'all' in member_types:
+ member_types = all_member_types
+
if 'user' in member_types:
filter += ('(&(sAMAccountName=%s)(samAccountType=%d))' %
(ldb.binary_encode(member), dsdb.ATYPE_NORMAL_ACCOUNT))