aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go2
-rw-r--r--read.go9
2 files changed, 8 insertions, 3 deletions
diff --git a/main.go b/main.go
index 9267175..381c3b5 100644
--- a/main.go
+++ b/main.go
@@ -371,7 +371,7 @@ func (server *Server) objectExists(dn string) (bool, error) {
return false, err
}
- data, _, err := server.kv.List(prefix+"/", nil)
+ data, _, err := server.kv.List(prefix+"/attribute=", nil)
if err != nil {
return false, err
}
diff --git a/read.go b/read.go
index 43833e8..9af9dbd 100644
--- a/read.go
+++ b/read.go
@@ -103,8 +103,13 @@ func (server *Server) handleSearchInternal(state *State, w ldap.ResponseWriter,
if err != nil {
return ldap.LDAPResultInvalidDNSyntax, err
}
+ if r.Scope() == message.SearchRequestScopeBaseObject {
+ basePath += "/attribute="
+ } else {
+ basePath += "/"
+ }
- data, _, err := server.kv.List(basePath+"/", nil)
+ data, _, err := server.kv.List(basePath, nil)
if err != nil {
return ldap.LDAPResultOperationsError, err
}
@@ -114,7 +119,7 @@ func (server *Server) handleSearchInternal(state *State, w ldap.ResponseWriter,
return ldap.LDAPResultOperationsError, err
}
- server.logger.Tracef("in %s: %#v", basePath+"/", data)
+ server.logger.Tracef("in %s: %#v", basePath, data)
server.logger.Tracef("%#v", entries)
for dn, entry := range entries {