Univention Bugzilla – Full Text Bug Listing |
Summary: | e-mail property contains previous address as default | ||
---|---|---|---|
Product: | UCS | Reporter: | Jan Christoph Ebersbach <ebersbach> |
Component: | UMC - Users | Assignee: | Johannes Keiser <keiser> |
Status: | CLOSED FIXED | QA Contact: | Florian Best <best> |
Severity: | normal | ||
Priority: | P5 | CC: | best, david.vogt |
Version: | UCS 4.2 | Flags: | best:
Patch_Available+
|
Target Milestone: | UCS 4.2-1-errata | ||
Hardware: | Other | ||
OS: | Linux | ||
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?: | Yes | ISV affected?: | |
Waiting Support: | Flags outvoted (downgraded) after PO Review: | ||
Ticket number: | 2016041821000301 | Bug group (optional): | External feedback |
Max CVSS v3 score: | |||
Attachments: |
Test script to reproduce the issue
patch patch |
Description
Jan Christoph Ebersbach
2016-04-21 14:02:11 CEST
Created attachment 7609 [details]
Test script to reproduce the issue
It doesn't fail on my machine (UCS 4.1-1). # python test.py <univention.admin.uldap.position instance at 0x1752cf8> <univention.admin.uldap.access instance at 0x1752ea8> 1 2 ['test0022@school.local'] The test is written backwards.. the assert on the last line accepts it's input if the problem exists :) So, to let the test crash when the problem exists, change it to the following instead: assert obj2['e-mail'] != obj['e-mail'] Ah yes, so you want that the email address is automatically (re)set to a new value. (In reply to Florian Best from comment #4) > Ah yes, so you want that the email address is automatically (re)set to a new > value. Err, oh I see. The default value is replaced to that last used address. Created attachment 7611 [details]
patch
Attached is a patch which fixes the issue. The problem is that the default() function of the property returns the original list which is modified instead of a copy.
>>> import univention.admin.handlers.users.user >>> email = univention.admin.handlers.users.user.property_descriptions['e-mail'] >>> lo, po = univention.admin.uldap.getMachineConnection() >>> obj = univention.admin.handlers.users.user.object(None, lo, po) >>> obj['mailPrimaryAddress'] = 'foo@bar.baz' >>> email.default(obj) ['foo@bar.baz'] >>> email.base_default ['foo@bar.baz'] Created attachment 7612 [details]
patch
Even a better patch - it allows base_default to be set from the outside as it is done by extended attributes/templates.
(In reply to Florian Best from comment #8) > Created attachment 7612 [details] > patch > > Even a better patch - it allows base_default to be set from the outside as > it is done by extended attributes/templates. Applied patch: r 80415 univention-directory-manager-modules (12.0.17-20) * Bug #41092 Copy base_default value for modification YAML: r 80417 OK: fix OK: YAML |