Univention Bugzilla – Bug 47818
LDAP objectclass violation when creating UMC portal entry
Last modified: 2018-09-26 13:24:50 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.
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
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
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.
<http://errata.software-univention.de/ucs/4.3/252.html>