Skip to content

Commit d27cc40

Browse files
committed
Adding ldap.EscapeFilter
- Prevents break search filter strings with special characters - go-ldap/ldap#338 (comment)
1 parent 2a89abe commit d27cc40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ldapauth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func LdapCheckUserGroups(conn *ldap.Conn, config *Config, entry *ldap.Entry, use
268268
"(member=%s)"+
269269
"(uniqueMember=%s)"+
270270
"(memberUid=%s)"+
271-
")", entry.DN, entry.DN, username)
271+
")", ldap.EscapeFilter(entry.DN), ldap.EscapeFilter(entry.DN), ldap.EscapeFilter(username))
272272

273273
LoggerDEBUG.Printf("Searching Group: '%s' with User: '%s'", g, entry.DN)
274274

0 commit comments

Comments
 (0)