Support dash in LDAP attribute names in filters.

This commit is contained in:
Chris Church
2017-10-08 22:21:32 -04:00
committed by Matthew Jones
parent f93506fe2c
commit c067788428
2 changed files with 6 additions and 1 deletions

View File

@@ -47,7 +47,7 @@ def validate_ldap_filter(value, with_user=False):
dn_value = value.replace('%(user)s', 'USER')
else:
dn_value = value
if re.match(r'^\([A-Za-z0-9]+?=[^()]+?\)$', dn_value):
if re.match(r'^\([A-Za-z0-9-]+?=[^()]+?\)$', dn_value):
return
elif re.match(r'^\([&|!]\(.*?\)\)$', dn_value):
try: