mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-14 01:20:27 +00:00
escape special chars when creating group filter.
The LDAP search filter used for group queries needs to be escaped so that group names with special characters will not break the search filter in queries.
This commit is contained in:
parent
9f29a8e154
commit
0ad5d46a4c
@ -171,7 +171,7 @@ class User(db.Model):
|
|||||||
whether a user is allowed to enter or not
|
whether a user is allowed to enter or not
|
||||||
"""
|
"""
|
||||||
LDAP_BASE_DN = Setting().get('ldap_base_dn')
|
LDAP_BASE_DN = Setting().get('ldap_base_dn')
|
||||||
groupSearchFilter = "(&(objectcategory=group)(member=%s))" % groupDN
|
groupSearchFilter = "(&(objectcategory=group)(member=%s))" % ldap.filter.escape_filter_chars(groupDN)
|
||||||
result = [groupDN]
|
result = [groupDN]
|
||||||
try:
|
try:
|
||||||
groups = self.ldap_search(groupSearchFilter, LDAP_BASE_DN)
|
groups = self.ldap_search(groupSearchFilter, LDAP_BASE_DN)
|
||||||
|
Loading…
Reference in New Issue
Block a user