summaryrefslogtreecommitdiffstats
path: root/server_search.go
diff options
context:
space:
mode:
authorViktor Kojouharov <vkojouharov@gmail.com>2019-07-03 20:24:33 +0200
committerNed McClain <nedmcclain@gmail.com>2019-07-03 20:24:33 +0200
commit09931d85c0ffc965b063db4b63071e121106dfaf (patch)
treed83bf549a182fe09fc6338e06de3d6bf40fd90b5 /server_search.go
parentmake serve function public (#4) (diff)
downloadldap-09931d85c0ffc965b063db4b63071e121106dfaf.tar
ldap-09931d85c0ffc965b063db4b63071e121106dfaf.tar.gz
ldap-09931d85c0ffc965b063db4b63071e121106dfaf.tar.bz2
ldap-09931d85c0ffc965b063db4b63071e121106dfaf.tar.lz
ldap-09931d85c0ffc965b063db4b63071e121106dfaf.tar.xz
ldap-09931d85c0ffc965b063db4b63071e121106dfaf.tar.zst
ldap-09931d85c0ffc965b063db4b63071e121106dfaf.zip
Diffstat (limited to '')
-rw-r--r--server_search.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/server_search.go b/server_search.go
index 3fc91c5..b4f7a5f 100644
--- a/server_search.go
+++ b/server_search.go
@@ -3,9 +3,10 @@ package ldap
import (
"errors"
"fmt"
- "github.com/nmcclain/asn1-ber"
"net"
"strings"
+
+ ber "github.com/nmcclain/asn1-ber"
)
func HandleSearchRequest(req *ber.Packet, controls *[]Control, messageID uint64, boundDN string, server *Server, conn net.Conn) (resultErr error) {
@@ -161,7 +162,7 @@ func filterAttributes(entry *Entry, attributes []string) (*Entry, error) {
for _, attr := range entry.Attributes {
for _, requested := range attributes {
- if strings.ToLower(attr.Name) == strings.ToLower(requested) {
+ if requested == "*" || strings.ToLower(attr.Name) == strings.ToLower(requested) {
newAttributes = append(newAttributes, attr)
}
}