Handle search attribute *
This commit is contained in:
parent
9e365d4b53
commit
e52a1f74a3
3 changed files with 6 additions and 4 deletions
|
@ -12,7 +12,7 @@ job "directory" {
|
||||||
task "server" {
|
task "server" {
|
||||||
driver = "docker"
|
driver = "docker"
|
||||||
config {
|
config {
|
||||||
image = "lxpz/bottin_amd64:8"
|
image = "lxpz/bottin_amd64:10"
|
||||||
readonly_rootfs = true
|
readonly_rootfs = true
|
||||||
port_map {
|
port_map {
|
||||||
ldap_port = 389
|
ldap_port = 389
|
||||||
|
|
1
main.go
1
main.go
|
@ -1,6 +1,5 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
|
|
7
read.go
7
read.go
|
@ -124,7 +124,7 @@ func (server *Server) handleSearchInternal(state *State, w ldap.ResponseWriter,
|
||||||
}
|
}
|
||||||
} else if r.Scope() == message.SearchRequestSingleLevel {
|
} else if r.Scope() == message.SearchRequestSingleLevel {
|
||||||
objectLevel := len(strings.Split(dn, ","))
|
objectLevel := len(strings.Split(dn, ","))
|
||||||
if objectLevel != baseObjectLevel + 1 {
|
if objectLevel != baseObjectLevel+1 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,10 @@ func (server *Server) handleSearchInternal(state *State, w ldap.ResponseWriter,
|
||||||
if len(r.Attributes()) > 0 {
|
if len(r.Attributes()) > 0 {
|
||||||
found := false
|
found := false
|
||||||
for _, requested := range r.Attributes() {
|
for _, requested := range r.Attributes() {
|
||||||
if strings.EqualFold(string(requested), attr) {
|
if string(requested) == "1.1" && len(r.Attributes()) == 1 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if string(requested) == "*" || strings.EqualFold(string(requested), attr) {
|
||||||
found = true
|
found = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue