Browse Source

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.
for-closed-social
Jochen Rill 7 years ago
committed by Lauris BH
parent
commit
f94e6fd7a5
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      modules/auth/ldap/ldap.go

+ 1
- 1
modules/auth/ldap/ldap.go View File

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

Loading…
Cancel
Save