refactor: ldap search request

This commit is contained in:
710leo 2021-11-11 15:16:26 +08:00
parent 6d24b07573
commit 0254a4ec34
1 changed files with 2 additions and 2 deletions

View File

@ -87,7 +87,7 @@ func ldapReq(user, pass string) (*ldap.SearchResult, error) {
searchRequest := ldap.NewSearchRequest(
lc.BaseDn, // The base dn to search
ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false,
fmt.Sprintf(lc.AuthFilter, user), // The filter to apply
fmt.Sprintf(lc.AuthFilter, ldap.EscapeFilter(user)), // The filter to apply
genLdapAttributeSearchList(), // A list attributes to retrieve
nil,
)