baseldap: de-duplicate passed attributes when checking for limits

LDAP attribute options aren't enforced in the schema, thus we strip them
when checking attribute conformance with the schema. This, however, can
leave us with a situation when multiple base LDAP attribute names are
present in the list of attribute names to check.

Use set of attribute names to deduplicate the list.

Fixes: https://pagure.io/freeipa/issue/8328

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Alexander Bokovoy
2020-05-19 11:58:56 -04:00
committed by Rob Crittenden
parent 47bddf4f45
commit 32c6b02eed
2 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -290,7 +290,8 @@ class test_krbtpolicy(Declarative):
command=(
'krbtpolicy_mod', [user1], dict(setattr=u'givenname=Pete')
),
expected=errors.ObjectclassViolation(info='attribute "givenname" not allowed'),
expected=errors.ObjectclassViolation(
info='these attributes are not allowed: givenname'),
),
]
for (value, error) in invalid_values: