Bug fix: case-insensitive value match (except for passwords)
This commit is contained in:
parent
e9e7a4cb4b
commit
4c037dcb94
3 changed files with 10 additions and 2 deletions
|
@ -12,7 +12,7 @@ job "directory" {
|
||||||
task "server" {
|
task "server" {
|
||||||
driver = "docker"
|
driver = "docker"
|
||||||
config {
|
config {
|
||||||
image = "lxpz/bottin_amd64:4"
|
image = "lxpz/bottin_amd64:5"
|
||||||
readonly_rootfs = true
|
readonly_rootfs = true
|
||||||
port_map {
|
port_map {
|
||||||
ldap_port = 389
|
ldap_port = 389
|
||||||
|
|
2
read.go
2
read.go
|
@ -205,7 +205,7 @@ func applyFilter(entry Entry, filter message.Filter) (bool, error) {
|
||||||
for entry_desc, value := range entry {
|
for entry_desc, value := range entry {
|
||||||
if strings.EqualFold(entry_desc, desc) {
|
if strings.EqualFold(entry_desc, desc) {
|
||||||
for _, val := range value {
|
for _, val := range value {
|
||||||
if val == target {
|
if valueMatch(entry_desc, val, target) {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
8
util.go
8
util.go
|
@ -138,3 +138,11 @@ func genUuid() string {
|
||||||
}
|
}
|
||||||
return uuid.String()
|
return uuid.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func valueMatch(attr, val1, val2 string) bool {
|
||||||
|
if strings.EqualFold(attr, ATTR_USERPASSWORD) {
|
||||||
|
return val1 == val2
|
||||||
|
} else {
|
||||||
|
return strings.EqualFold(val1, val2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue