Bug 46427 - password export does not contain password changed by hook
password export does not contain password changed by hook
Status: REOPENED
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS@school maintainers
Oliver Friedrich
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-02-26 13:02 CET by Daniel Tröder
Modified: 2021-11-09 14:52 CET (History)
3 users (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?: 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.069
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 Daniel Tröder univentionstaff 2018-02-26 13:02:20 CET
In UserImport.create_and_modify_users() the password of new users are saved before running User.create() (because that removes it from the object) and after create() set on the object, so that it can be exported at a later time.

If a pre_create() or post_create() hook modifies the password, after create() it will be overwritten on the User object and the old password will be exported.

Also: a post_create() hook will not see the password.

Store the User objects password attribute after the pre_create() and restore it before the post_create() hook to fix both problems.
Comment 1 Michel Smidt 2020-07-10 13:54:30 CEST
This issue has been filed against UCS@school 4.2.

UCS@school 4.2 is out of maintenance and many UCS@school components have changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS@school versions, please reopen it and update the UCS@school version. In this case please provide detailed information on how this issue is affecting you.
Comment 2 Oliver Friedrich univentionstaff 2021-11-09 14:45:59 CET
This is still valid for UCS@School 4.4v9.

I was able to reproduce the bug with the birthday2password-Hook [1]: the passwords are set as desired, but the passwords in the summary differ. 

[1] https://git.knut.univention.de/univention/components/ucsschool-hooks/-/blob/4.4/pyhooks/birthday2password.py