From a525bcd1c2fcf64be2b610d33a732ef70f82d2c6 Mon Sep 17 00:00:00 2001 From: Yixin Hao Date: Sat, 22 Aug 2015 01:02:22 +0800 Subject: [PATCH] Fixing of ldap.go --- modules/auth/ldap/ldap.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/auth/ldap/ldap.go b/modules/auth/ldap/ldap.go index 37fd53c25..0230203e8 100644 --- a/modules/auth/ldap/ldap.go +++ b/modules/auth/ldap/ldap.go @@ -42,6 +42,9 @@ func (ls Ldapsource) FindUserDN(name, passwd string) (string, bool) { log.Trace("Search for LDAP user: %s", name) if ls.BindDN != "" { + var bd, bp string + // With palceholder in BindDN and no password, + // It will bind as combination define in BindDN with login password if ls.BindPassword == "" { bd = strings.Replace(ls.BindDN, "", name, -1) bp = passwd