Bug 49594 - Regression in determining default container for udm objects
Regression in determining default container for udm objects
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-1-errata
Assigned To: Florian Best
Johannes Keiser
:
Depends on:
Blocks: 49849
  Show dependency treegraph
 
Reported: 2019-06-04 14:42 CEST by Erik Damrose
Modified: 2019-08-29 12:23 CEST (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 3: Will affect average number of 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.137
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): External feedback, Regression, Usability
Max CVSS v3 score:
best: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Damrose univentionstaff 2019-06-04 14:42:53 CEST
A regression in UCS 4.4 can be found with the determination of the default container for some udm object types, at least nagios/service objects are affected.

To reproduce:
In 4.3 (tested with UCS: 4.3-2 errata229) one can create e.g. a new nagios service via UMC udm module. The object is created in cn=nagios,$ldap_base.

In 4.4 (4.4-0 errata137) the nagios service object will be created at the ldap base.

This is at least unexpected for admins. Additionally, the ldap base get cluttered, because some objects can not be moved by udm. It may be an issue if some services expect their objects to be in or below a certain container. It may also affect replication and ACLs.
Comment 1 Florian Best univentionstaff 2019-06-05 15:47:01 CEST
The reason is that the combobox for the container changed, so that it depends on the widget for the object-type.
Therefore prior a request for getting the initial value of the "container" widget was done with the "nagios/nagios" flavor/object-type.
Now, it used the selected object type (nagios/service).
And nagios/service doesn't define default_containers = ['cn=nagios'], so the objects are created at the ldap base.

From our own UDM handlers, only nagios objects are affected. A patch is:

diff --git a/management/univention-directory-manager-modules/modules/univention/admin/handlers/nagios/service.py b/management/univention-directory-manager-modules/modules/univention/admin/handlers/nagios/service.py
index 837a654c7e..4293a0638f 100644
--- a/management/univention-directory-manager-modules/modules/univention/admin/handlers/nagios/service.py
+++ b/management/univention-directory-manager-modules/modules/univention/admin/handlers/nagios/service.py
@@ -47,6 +47,7 @@ translation = univention.admin.localization.translation('univention.admin.handle
 _ = translation.translate

 module = 'nagios/service'
+default_containers = ['cn=nagios']

 childs = 0
 short_description = _('Nagios service')
diff --git a/management/univention-directory-manager-modules/modules/univention/admin/handlers/nagios/timeperiod.py b/management/univention-directory-manager-modules/modules/univention/admin/handlers/nagios/timeperiod.py
index 21b81625a0..d7488b5eb6 100644
--- a/management/univention-directory-manager-modules/modules/univention/admin/handlers/nagios/timeperiod.py
+++ b/management/univention-directory-manager-modules/modules/univention/admin/handlers/nagios/timeperiod.py
@@ -45,6 +45,7 @@ translation = univention.admin.localization.translation('univention.admin.handle
 _ = translation.translate

 module = 'nagios/timeperiod'
+default_containers = ['cn=nagios']

 childs = 0
 short_description = _('Nagios time period')
Comment 2 Timo Denissen univentionstaff 2019-06-17 09:52:30 CEST
This also happens with objects created in the "OX E-Mail" (but not the "OX Ressourcen") UMC module.
Comment 3 Florian Best univentionstaff 2019-07-01 11:04:19 CEST
(In reply to Timo Denissen from comment #2)
> This also happens with objects created in the "OX E-Mail" (but not the "OX
> Ressourcen") UMC module.
Yes, same for them: Missing definition of default_containers in the module definition.
Comment 4 Erik Damrose univentionstaff 2019-07-11 15:45:33 CEST
https://help.univention.com/t/nagios-container/12514
Comment 5 Daniel Tröder univentionstaff 2019-07-15 16:28:25 CEST
Please add a warning to UDM (appearing in logfiles and on the "udm" cmdline) when an object is created at the LDAP base, and that was not explicitly requested.

Reason: this is almost always an undesired result for the customer, which can be easily fixed by the creators of the UDM module.
Comment 6 Florian Best univentionstaff 2019-07-15 16:43:15 CEST
(In reply to Daniel Tröder from comment #5)
> Please add a warning to UDM (appearing in logfiles and on the "udm" cmdline)
> when an object is created at the LDAP base, and that was not explicitly
> requested.
> 
> Reason: this is almost always an undesired result for the customer, which
> can be easily fixed by the creators of the UDM module.

The warning exists already:

# udm users/user create --set username=foob --set lastname=bar --set password=univention
WARNING: The object is not going to be created underneath of its default containers.
Object created: uid=foob,l=school,l=dev
Comment 7 Daniel Tröder univentionstaff 2019-07-15 17:24:57 CEST
(In reply to Florian Best from comment #6)
> The warning exists already:
> 
> # udm users/user create --set username=foob --set lastname=bar --set
> password=univention
> WARNING: The object is not going to be created underneath of its default
> containers.
> Object created: uid=foob,l=school,l=dev

Will this warning also appear, if there is no default container configured for the module?
Comment 8 Florian Best univentionstaff 2019-07-15 18:30:21 CEST
(In reply to Daniel Tröder from comment #7)
> (In reply to Florian Best from comment #6)
> > The warning exists already:
> > 
> > # udm users/user create --set username=foob --set lastname=bar --set
> > password=univention
> > WARNING: The object is not going to be created underneath of its default
> > containers.
> > Object created: uid=foob,l=school,l=dev
> 
> Will this warning also appear, if there is no default container configured
> for the module?
No... Otherwise it would be displayed for container/* as well, etc.
Comment 9 Florian Best univentionstaff 2019-07-16 20:21:16 CEST
Patch applied:

univention-directory-manager-modules (14.0.13-1)
a20f76d88717 | Bug #49594: nagios objects are created again in their default containers

univention-directory-manager-modules.yaml
a20f76d88717 | Bug #49594: nagios objects are created again in their default containers
Comment 10 Johannes Keiser univentionstaff 2019-07-19 15:48:11 CEST
OK: nagios objects are created in default container
OK: yaml (591927e79e Bug #49594: yaml)
-> verified
Comment 11 Florian Best univentionstaff 2019-07-25 18:44:26 CEST
Caused by Bug #46919.
Comment 12 Arvid Requate univentionstaff 2019-07-31 13:58:40 CEST
<http://errata.software-univention.de/ucs/4.4/205.html>