Bug 42903 - extended attribute "mailhomeserver" sets wrong value if there is more than one mailserver present
extended attribute "mailhomeserver" sets wrong value if there is more than on...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM - Extended Attributes
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-4-errata
Assigned To: Florian Best
Stefan Gohmann
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-09 12:18 CET by Jens Thorp-Hansen
Modified: 2017-02-22 12:32 CET (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?: 2: Will only affect a 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.091
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2016101421000314, 2017011921000311
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 Jens Thorp-Hansen univentionstaff 2016-11-09 12:18:38 CET
Testingenvironment:

10.200.6.100 (mailserver_master)
10.200.6.101 (mailserver_backup)

- create extended attribute "mailhomeserver" 
- create template
- check extended attribute "mailhomeserver" - drop down menu with the master a first place and backup at second place
- set second place (backup) 
- save
- create new user and use template
- check "mailhomeserver" at the created user - it is drop down menu with the master a first place and backup at second place - the value shows the first place (master)
Comment 1 Jens Thorp-Hansen univentionstaff 2016-11-09 12:30:20 CET
extended attribute via udm:

root@ucs:~# udm settings/extended_attribute create --position "cn=custom attributes,cn=univention,$(ucr get ldap/base)" \
--set objectClass=univentionMailRouting \
--set module=settings/usertemplate \
--set translationTabName='"de_DE" "Mail"' \
--set shortDescription="Mail Home Server" \
--set groupName="Advanced settings" \
--set CLIName=UniventionDovecotUserHomeServer \
--set translationGroupName='"de_DE" "Erweiterte Einstellungen"' \
--set translationShortDescription='"de_DE" "Mail Home Server"' \
--set tabName="Mail" \
--set syntax=MailHomeServer \
--set tabAdvanced=1 \
--set name="UniventionDovecotUserHomeServer" \
--set mayChange=1 \
--set ldapMapping="univentionMailHomeServer"
Comment 2 Christina Scheinig univentionstaff 2017-01-20 15:06:08 CET
happened again at 2017011921000311
Comment 3 Florian Best univentionstaff 2017-02-20 20:23:39 CET
The code for Bug #33329, which was supposed to set the first value if the widgets first entry is empty, didn't check if the value is already set and overwrote it always with the very first truish value.

univention-management-console-module-udm (6.0.11-39):
r76890 | Bug #42903: fix setting of mailHomeServer via template

univention-management-console-module-udm.yaml:
r76891 | YAML Bug #42903

UCS 4.2
univention-management-console-module-udm (7.0.5-1):
r76892 | Bug #42903: fix setting of mailHomeServer via template
Comment 4 Stefan Gohmann univentionstaff 2017-02-21 09:22:21 CET
It doesn't work in my tests: 
 10.201.41.1
 Add a user with the template v-slave414
 Afterwards, the user has the mailHomServer slave413 instead of slave414
Comment 5 Florian Best univentionstaff 2017-02-21 14:51:52 CET
Hm, I moved the logic/workaround for the nonempty default value into the backend to prevent these race condition:
The value was set first to the random value, then set to the value from the template and then again back to the random value.

univention-management-console-module-udm (6.0.11-40):
r76902 | Bug #42903: move nonempty_is_default logic into backend to prevent race conditions in the Javascript frontend

The extended attribute definition is wrong!
It sets UniventionDovecotUserHomeServer instead of mailHomeServer as CLI name but only for settings/usertemplate and not for users/user.
It must be set either for both or for none.

Merge to UCS 4.2:
univention-management-console-module-udm (7.0.5-1):
r76904 | Bug #42903: move nonempty_is_default logic into backend to prevent race conditions in the Javascript frontend
Comment 6 Stefan Gohmann univentionstaff 2017-02-21 15:30:59 CET
Tests: OK

Code review: OK

UCS 4.2 merge: OK

YAML: OK


(In reply to Florian Best from comment #5)
> The extended attribute definition is wrong!
> It sets UniventionDovecotUserHomeServer instead of mailHomeServer as CLI
> name but only for settings/usertemplate and not for users/user.
> It must be set either for both or for none.

Sorry, my fault, the attribute name is wrong but it is right that it is only registered for settings/usertemplate. The correct extended attribute should be:

udm settings/extended_attribute create --position "cn=custom attributes,cn=univention,$(ucr get ldap/base)" \
--set objectClass=univentionMailRouting \
--set module=settings/usertemplate \
--set translationTabName='"de_DE" "Mail"' \
--set shortDescription="Mail Home Server" \
--set groupName="Advanced settings" \
--set CLIName=mailHomeServer \
--set translationGroupName='"de_DE" "Erweiterte Einstellungen"' \
--set translationShortDescription='"de_DE" "Mail Home Server"' \
--set tabName="Mail" \
--set syntax=MailHomeServer \
--set tabAdvanced=1 \
--set name="mailHomeServer" \
--set mayChange=1 \
--set ldapMapping="univentionMailHomeServer"
Comment 7 Janek Walkenhorst univentionstaff 2017-02-22 12:32:59 CET
<http://errata.software-univention.de/ucs/4.1/402.html>