summaryrefslogtreecommitdiffstats
path: root/server_search.go
diff options
context:
space:
mode:
authorned <ned@appliedtrust.com>2015-06-02 20:56:59 +0200
committerned <ned@appliedtrust.com>2015-06-02 20:56:59 +0200
commit4237472cb11fa548c203e6fa21ff372728f60f3b (patch)
tree33a14f140765cc162ab89e9ffc90a0d42a9134bf /server_search.go
parentTolerate DerefAliases requests w/o falling over (diff)
downloadldap-4237472cb11fa548c203e6fa21ff372728f60f3b.tar
ldap-4237472cb11fa548c203e6fa21ff372728f60f3b.tar.gz
ldap-4237472cb11fa548c203e6fa21ff372728f60f3b.tar.bz2
ldap-4237472cb11fa548c203e6fa21ff372728f60f3b.tar.lz
ldap-4237472cb11fa548c203e6fa21ff372728f60f3b.tar.xz
ldap-4237472cb11fa548c203e6fa21ff372728f60f3b.tar.zst
ldap-4237472cb11fa548c203e6fa21ff372728f60f3b.zip
Diffstat (limited to 'server_search.go')
-rw-r--r--server_search.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/server_search.go b/server_search.go
index 4dda9a3..74d06b9 100644
--- a/server_search.go
+++ b/server_search.go
@@ -46,11 +46,6 @@ func HandleSearchRequest(req *ber.Packet, controls *[]Control, messageID uint64,
for i, entry := range searchResp.Entries {
if server.EnforceLDAP {
- // size limit
- if searchReq.SizeLimit > 0 && i >= searchReq.SizeLimit {
- break
- }
-
// filter
keep, resultCode := ServerApplyFilter(filterPacket, entry)
if resultCode != LDAPResultSuccess {
@@ -77,6 +72,11 @@ func HandleSearchRequest(req *ber.Packet, controls *[]Control, messageID uint64,
}
}
+ // size limit
+ if searchReq.SizeLimit > 0 && i >= searchReq.SizeLimit {
+ break
+ }
+
// attributes
if len(searchReq.Attributes) > 1 || (len(searchReq.Attributes) == 1 && len(searchReq.Attributes[0]) > 0) {
entry, err = filterAttributes(entry, searchReq.Attributes)