diff options
author | zeripath <art27@cantab.net> | 2021-09-10 23:46:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-11 00:46:27 +0200 |
commit | f394019e9d2db7be730ac3f972a6f509bf78bc03 (patch) | |
tree | d4babe3b71025aa4690c22ed2728671cf878cae0 /services/auth | |
parent | 77f604a9284887758e604e92d2c9b40697db0a23 (diff) | |
download | gitea-f394019e9d2db7be730ac3f972a6f509bf78bc03.tar.gz gitea-f394019e9d2db7be730ac3f972a6f509bf78bc03.zip |
Report the associated filter if there is an error in LDAP (#17014)
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 <art27@cantab.net>
Diffstat (limited to 'services/auth')
-rw-r--r-- | services/auth/source/ldap/source_search.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/services/auth/source/ldap/source_search.go b/services/auth/source/ldap/source_search.go index f2acbb0d4b..71db0b770a 100644 --- a/services/auth/source/ldap/source_search.go +++ b/services/auth/source/ldap/source_search.go @@ -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 { @@ -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 { |