outposts/ldap: fix logic error

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-09-22 13:19:50 +02:00
parent 0f8880ab0a
commit ebc06f1abe

View file

@ -149,10 +149,10 @@ func (pi *ProviderInstance) ensureAttributes(attrs []*ldap.EntryAttribute, shoul
} }
func (pi *ProviderInstance) mustHaveAttribute(attrs []*ldap.EntryAttribute, name string, value []string) []*ldap.EntryAttribute { func (pi *ProviderInstance) mustHaveAttribute(attrs []*ldap.EntryAttribute, name string, value []string) []*ldap.EntryAttribute {
shouldSet := false shouldSet := true
for _, attr := range attrs { for _, attr := range attrs {
if attr.Name == name { if attr.Name == name {
shouldSet = true shouldSet = false
} }
} }
if shouldSet { if shouldSet {