Bug fix: case-insensitive value match (except for passwords)

This commit is contained in:
Alex 2020-02-02 13:32:12 +01:00
parent e9e7a4cb4b
commit 4c037dcb94
3 changed files with 10 additions and 2 deletions

View File

@ -12,7 +12,7 @@ job "directory" {
task "server" {
driver = "docker"
config {
image = "lxpz/bottin_amd64:4"
image = "lxpz/bottin_amd64:5"
readonly_rootfs = true
port_map {
ldap_port = 389

View File

@ -205,7 +205,7 @@ func applyFilter(entry Entry, filter message.Filter) (bool, error) {
for entry_desc, value := range entry {
if strings.EqualFold(entry_desc, desc) {
for _, val := range value {
if val == target {
if valueMatch(entry_desc, val, target) {
return true, nil
}
}

View File

@ -138,3 +138,11 @@ func genUuid() 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)
}
}