Fix wrong handling of multi value attributes
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
While ldapsearch doesn't seem to mind, apps like keycloak seem to have issues with adding multiple attributes with different values. While the resulting ldif in ldapsearch is indistinguishable there seems to be a slight different on the protocol level. If adding multiple attributes with the same name and different values, keycloak will only see the last entry. But adding a single attribute a slice of values is seems to handle it correctly.
This commit is contained in:
parent
dbd9003714
commit
d28e669676
1 changed files with 3 additions and 2 deletions
5
read.go
5
read.go
|
@ -213,10 +213,11 @@ func (server *Server) handleSearchInternal(state *State, w ldap.ResponseWriter,
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// Send result
|
// Send result
|
||||||
|
resultVals := []message.AttributeValue{}
|
||||||
for _, v := range val {
|
for _, v := range val {
|
||||||
e.AddAttribute(message.AttributeDescription(attr),
|
resultVals = append(resultVals, message.AttributeValue(v))
|
||||||
message.AttributeValue(v))
|
|
||||||
}
|
}
|
||||||
|
e.AddAttribute(message.AttributeDescription(attr), resultVals...)
|
||||||
}
|
}
|
||||||
w.Write(e)
|
w.Write(e)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue