Bug 47818 - LDAP objectclass violation when creating UMC portal entry
LDAP objectclass violation when creating UMC portal entry
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.3
Other Linux
: P5 normal (vote)
: UCS 4.3-2-errata
Assigned To: Sönke Schwardt-Krummrich
Ole Schwiegert
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-09-14 14:20 CEST by Sönke Schwardt-Krummrich
Modified: 2018-09-26 13:24 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.034
Enterprise Customer affected?:
School Customer affected?:
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 Sönke Schwardt-Krummrich univentionstaff 2018-09-14 14:20:57 CEST
During implementation a new script creating an UMC portal entry via python UDM, an LDAP object class violation occurred.

An attempt was made to describe the LDAP attribute univentionComputerPortal with a second value on the host object, but this is a single value attribute according to the LDAP schema and therefore an error was returned.

During debugging it turned out that the computer object in settings/portal was not opened correctly. The object is read from LDAP using

compobj = univention.admin.modules.lookup('computers/computer', ....)

and then settings/portal.py checks whether the UDM module used by compobj (here computers/domaincontroller_master) has already been initialized. If not, the univention.admin.modules.init() for the module is done. The host object is then opened via compobj.open().

However, this is not sufficient. During init() the mapping in the domaincontroller_master class is extended for new instances, but the existing instance compobj did not notice this anymore. Probably because of this the property "portal" was not set in open() and was empty.

When the script wrote a value into "portal", the UDM executed an ADD (<empty> → <newvalue>) instead of a REPLACE (<oldvalue> → <newvalue>) for the LDAP attribute, which led to the error message.
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2018-09-14 15:07:15 CEST
Fixed in branch sschwardt/47818/4.3/udm-portal-fix
Branch contains:
- fix for admin/handlers/settings/portal.py
- new ucs-test script that triggers the object class violation if fix is missing
- advisory
Comment 2 Sönke Schwardt-Krummrich univentionstaff 2018-09-24 13:09:40 CEST
The code now rereads the UDM objects found by lookup(), if the corresponding UDM modules have been initialized _after_ the lookup() call.

Branch merged:

c0308c9285 Bug #47818: update advisory
7ed2f6f95d Bug #47818: Merge branch 'sschwardt/47818/4.3/udm-portal-fix' into 4.3-2
ed446c581c Bug #47818: add advisory
24cd42388d Bug #47818: add changelog entry for ucs-test
c5dee27a7a Bug #47818: add ucs test 71_udm-settings/40_create_portal_entry
2641650a29 Bug #47818: add changelog entry
e384014d6f Bug #47818: fix portal assignment to a computer object

Package: univention-directory-manager-modules
Version: 13.0.24-1A~4.3.0.201809241303
Branch: ucs_4.3-0
Scope: errata4.3-2

Package: ucs-test
Version: 8.0.28-193A~4.3.0.201809241305
Branch: ucs_4.3-0
Scope: errata4.3-2
Comment 3 Ole Schwiegert univentionstaff 2018-09-25 11:08:03 CEST
Changelog & Advisory: OK
Packages install: OK
Changes have desired effect: OK
Test works: OK

I tested the changes with the upcoming create demo portal script for ucsschool, where the error was originally discovered. With this fix everything works fine. The test also passes with the fix and fails if the fix is not installed.
Comment 4 Erik Damrose univentionstaff 2018-09-26 13:24:50 CEST
<http://errata.software-univention.de/ucs/4.3/252.html>