]> source.dussan.org Git - gitea.git/commit
Correction LDAP validation (#342)
authorDenis Denisov <denji@users.noreply.github.com>
Mon, 12 Dec 2016 00:46:51 +0000 (02:46 +0200)
committerLunny Xiao <xiaolunwen@gmail.com>
Mon, 12 Dec 2016 00:46:51 +0000 (08:46 +0800)
commitf0a989c1d0843ab47a48be5219470a93a462e302
treec6bb94aa8dc71559d5f69540a85b3ca928d26b8a
parentabcd39f7d52f6a9498b5f09a1d90c87da7c66909
Correction LDAP validation (#342)

* Correction LDAP username validation

As https://msdn.microsoft.com/en-us/library/aa366101(v=vs.85).aspx describe spaces should not be in start or at the end of username but they can be inside the username. So please check my solution for it.

* Check for zero length passwords in LDAP module.

According to https://tools.ietf.org/search/rfc4513#section-5.1.2 LDAP client should always check before bind whether a password is an empty value. There are at least one LDAP implementation which does not return error if you try to bind with DN set and empty password - AD.

* Clearing the login/email spaces at the [start/end]
models/login_source.go
modules/auth/ldap/ldap.go