Bug 54362 - UDM developer docs wrong regarding addlist modlist contents
UDM developer docs wrong regarding addlist modlist contents
Status: NEW
Product: UCS extended documentation
Classification: Unclassified
Component: Developer documentation
unspecified
Other Linux
: P5 normal (vote)
: ---
Assigned To: Docu maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-01-20 16:55 CET by Frank Greif
Modified: 2022-01-21 10:50 CET (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Greif univentionstaff 2022-01-20 16:55:08 CET
I'm developing an UDM hook that shall fire on user creation. While testing, sometimes the creation failed with error:

Failed to create LDAP object: ldapError: Object class violation: no structural object class provided

Trying to debug if my hook made something wrong, I reduced the Addlist hook to simply print out the current addlist. It shows two elements with the attribute name 'objectClass':

20.01.22 14:07:34.465  ADMIN       ( INFO    ) : autoExpire: addlist: [
    ...
    ('objectClass', b'', b'automount')
    ...
    ('objectClass', [b'sambaSamAccount', b'inetOrgPerson', b'univentionPWHistory', b'person', b'top', b'krb5Principal', b'shadowAccount', b'organizationalPerson', b'univentionMail', b'posixAccount', b'krb5KDCEntry']),
    ...
]

Whenever the 'automount' stanza arrives last -> user creation fails. This occurs randomly.
Comment 1 Florian Best univentionstaff 2022-01-20 17:22:45 CET
So the bug occurs with your hook enabled?
Please attach it here then.

a addlsit/modlist containing "objectClass" multiple times is valid - they should get merged at the end.
Comment 2 Frank Greif univentionstaff 2022-01-21 09:09:39 CET
So my assumption was wrong: that there must be only one occurrence of an attribute in this list (docs in https://docs.software-univention.de/developer-reference-5.0.html#udm:hook do not state it explcitly). -- I'll fix that.

Two related questions: is the addlist hook required to handle:

* mixed lists of two-tuples and three-tuples (docs say: addlist consists only of two-tuples)
* mixed data types of values, here: sometimes string, sometimes array of strings (docs say "list_of_values")

Either UDM should adhere to documented behaviour, or docs are wrong. Please advise.
Comment 3 Florian Best univentionstaff 2022-01-21 10:49:47 CET
(In reply to Frank Greif from comment #2)
> So my assumption was wrong: that there must be only one occurrence of an
> attribute in this list (docs in
> https://docs.software-univention.de/developer-reference-5.0.html#udm:hook do
> not state it explcitly). -- I'll fix that.
yep

> Two related questions: is the addlist hook required to handle:
> 
> * mixed lists of two-tuples and three-tuples (docs say: addlist consists
> only of two-tuples)
Unfortionately yes, because the addlist always also contains the modlist which is a 3-tuple. The docs are wrong here.

> * mixed data types of values, here: sometimes string, sometimes array of
> strings (docs say "list_of_values")
Yes, the addlist contains mixed types and it is essential to correctly interpret the values. The docs are wrong here.

> Either UDM should adhere to documented behaviour, or docs are wrong. Please
> advise.
We should precise the docs.