From: Björn Baumbach Date: Mon, 30 Dec 2019 12:57:11 +0000 (+0100) Subject: python/samdb: add type "all" to search for all common types of group members X-Git-Tag: samba-4.12.0rc1~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f9bf6b7856ee573d4f9f1bd0748ac46d24798d5c;p=thirdparty%2Fsamba.git python/samdb: add type "all" to search for all common types of group members Signed-off-by: Björn Baumbach Reviewed-by: Ralph Boehme --- 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))