Skip to content

Commit f94e6fd

Browse files
Jochen Rilllafriks
Jochen Rill
authored andcommitted
Correct ldap username validation. (#2880)
PR #342 was only partially applied. Spaces should not be at the start and end of a username but they can be inside.
1 parent 134958f commit f94e6fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/auth/ldap/ldap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func (ls *Source) sanitizedUserQuery(username string) (string, bool) {
6969

7070
func (ls *Source) sanitizedUserDN(username string) (string, bool) {
7171
// See http://tools.ietf.org/search/rfc4514: "special characters"
72-
badCharacters := "\x00()*\\,='\"#+;<> "
72+
badCharacters := "\x00()*\\,='\"#+;<>"
7373
if strings.ContainsAny(username, badCharacters) {
7474
log.Debug("'%s' contains invalid DN characters. Aborting.", username)
7575
return "", false

0 commit comments

Comments
 (0)