Skip to content

Commit

Permalink
Correct ldap username validation.
Browse files Browse the repository at this point in the history
PR go-gitea#342 was only partially applied. Spaces should not be at the start
and end of a username but they can be inside.
  • Loading branch information
Jochen Rill committed Nov 10, 2017
1 parent e22be08 commit b797de6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/auth/ldap/ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b797de6

Please sign in to comment.