Skip to content

Commit

Permalink
Report the associated filter if there is an error in LDAP (#17014)
Browse files Browse the repository at this point in the history
If there is an error when performing the admin or restricted filter search
ensure that the filter and the userDN are reported.

Signed-off-by: Andrew Thornton <[email protected]>
  • Loading branch information
zeripath authored Sep 10, 2021
1 parent 77f604a commit f394019
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/auth/source/ldap/source_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func checkAdmin(l *ldap.Conn, ls *Source, userDN string) bool {
sr, err := l.Search(search)

if err != nil {
log.Error("LDAP Admin Search failed unexpectedly! (%v)", err)
log.Error("LDAP Admin Search with filter %s for %s failed unexpectedly! (%v)", ls.AdminFilter, userDN, err)
} else if len(sr.Entries) < 1 {
log.Trace("LDAP Admin Search found no matching entries.")
} else {
Expand All @@ -181,7 +181,7 @@ func checkRestricted(l *ldap.Conn, ls *Source, userDN string) bool {
sr, err := l.Search(search)

if err != nil {
log.Error("LDAP Restrictred Search failed unexpectedly! (%v)", err)
log.Error("LDAP Restrictred Search with filter %s for %s failed unexpectedly! (%v)", ls.RestrictedFilter, userDN, err)
} else if len(sr.Entries) < 1 {
log.Trace("LDAP Restricted Search found no matching entries.")
} else {
Expand Down

0 comments on commit f394019

Please sign in to comment.