internal/ldap: Log unsupported search filters

This commit is contained in:
Michael Aldridge 2021-10-16 18:01:02 -05:00
parent 65e76b3c73
commit 69798ffe7a

View file

@ -37,6 +37,7 @@ func (s *server) handleSearchEntities(w ldap.ResponseWriter, m *ldap.Message) {
if err != nil {
// If err is non-nil at this point it must mean that
// the above match didn't find a supported filter.
s.l.Warn("Unsupported Search Filter, this is a bug, please file a report", "filter", r.Filter())
res := ldap.NewSearchResultDoneResponse(ldap.LDAPResultUnwillingToPerform)
res.SetDiagnosticMessage("Filter type not supported")
w.Write(res)
@ -105,6 +106,7 @@ func (s *server) handleSearchGroups(w ldap.ResponseWriter, m *ldap.Message) {
if err != nil {
// If err is non-nil at this point it must mean that
// the above match didn't find a supported filter.
s.l.Warn("Unsupported Search Filter, this is a bug, please file a report", "filter", r.Filter())
res := ldap.NewSearchResultDoneResponse(ldap.LDAPResultUnwillingToPerform)
res.SetDiagnosticMessage("Filter type not supported")
w.Write(res)