summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2019-12-30 13:57:26 +0100
committerStefan Metzmacher <metze@samba.org>2020-01-21 14:38:46 +0000
commita4d77bfd90d09b37b89f99042d9e0e3d5b102677 (patch)
tree795d2c627ff5b0766b7ab571046b326dfffb452a /python
parentf9bf6b7856ee573d4f9f1bd0748ac46d24798d5c (diff)
downloadsamba-a4d77bfd90d09b37b89f99042d9e0e3d5b102677.tar.gz
python/samdb: validation of group member types for group member filter
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.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/samba/samdb.py b/python/samba/samdb.py
index 4606b607323..af3a7ddf96a 100644
--- a/python/samba/samdb.py
+++ b/python/samba/samdb.py
@@ -264,6 +264,12 @@ pwdLastSet: 0
if 'all' in member_types:
member_types = all_member_types
+ for member_type in member_types:
+ if member_type not in all_member_types:
+ raise Exception('Invalid group member type "%s". '
+ 'Valid types are %s and all.' %
+ (member_type, ", ".join(all_member_types)))
+
if 'user' in member_types:
filter += ('(&(sAMAccountName=%s)(samAccountType=%d))' %
(ldb.binary_encode(member), dsdb.ATYPE_NORMAL_ACCOUNT))