From ab4283ceac425c85492439d3a81f317afe12d539 Mon Sep 17 00:00:00 2001 From: William Luke Date: Fri, 5 Jul 2024 16:16:02 -0500 Subject: [PATCH] Fix looping over multiple entities or groups --- internal/ldap/search.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/ldap/search.go b/internal/ldap/search.go index 5613e6b..572f130 100644 --- a/internal/ldap/search.go +++ b/internal/ldap/search.go @@ -80,9 +80,7 @@ func (s *server) handleSearchEntities(w ldap.ResponseWriter, m *ldap.Message) { if exprAnd { e, complete, err = s.entitySearchResultWithMatch(ctx, ents[i], r.BaseObject(), r.Attributes(), matchGroup) if !complete { - res := ldap.NewSearchResultDoneResponse(ldap.LDAPResultSuccess) - w.Write(res) - return + continue } } else { e, err = s.entitySearchResult(ctx, ents[i], r.BaseObject(), r.Attributes()) @@ -236,9 +234,7 @@ func (s *server) handleSearchGroups(w ldap.ResponseWriter, m *ldap.Message) { s.l.Debug("Match UID: ", matchUid) e, complete, err = s.groupSearchResultWithMatch(ctx, groups[i], r.BaseObject(), r.Attributes(), matchUid) if !complete { - res := ldap.NewSearchResultDoneResponse(ldap.LDAPResultSuccess) - w.Write(res) - return + continue } } else { e, err = s.groupSearchResult(ctx, groups[i], r.BaseObject(), r.Attributes())