Bug 47183 - pre_modify() hooks are called upon user deletion with deletion_grace_time
Summary: pre_modify() hooks are called upon user deletion with deletion_grace_time
Status: CLOSED WORKSFORME
Alias: None
Product: UCS@school
Classification: Unclassified
Component: Import scripts
Version: UCS@school 4.2
Hardware: Other Linux
: P5 normal
Target Milestone: UCS@school 4.3 v4
Assignee: Daniel Tröder
QA Contact: Sönke Schwardt-Krummrich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-12 12:26 CEST by Sönke Schwardt-Krummrich
Modified: 2018-07-04 18:12 CEST (History)
0 users

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?: 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.103
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Customer ID: 00009, 39720
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2018-06-12 12:26:55 CEST
We just noticed that the pre_modify() hooks are called upon user deletion with deletion_grace_time. I assumed the pre/post_delete hooks to be called.

We should create a flow chart, when which hook is/should be called and then fix the code accordingly.
Comment 1 Daniel Tröder univentionstaff 2018-06-14 14:44:38 CEST
In case we would want to change this. It'd be done with this commit in branch dtroeder/45715_4.3_checks_in_dry-run:

[dtroeder/45715_4.3_checks_in_dry-run] 7ffc2ec8 Bug #47183: run remove hooks when deleting with grace, instead of modify hooks

One line (changing the signature of modify()) slipped though into commit:

[dtroeder/45715_4.3_checks_in_dry-run] 852bad00 Bug #45715: use admin connection in a real run, use machine connection during a dry-run
Comment 2 Daniel Tröder univentionstaff 2018-06-22 10:50:25 CEST
The remove hooks will be executed when the user is deleted by /usr/share/ucs-school-import/scripts/ucs-school-purge-expired-users.

The currently executed modify hooks (when deactivating a user) can be used to detect this, by looking at udm_obj["ucsschoolPurgeTimestamp"] or ImportUser.has_purge_timestamp().

The relevant code in dtroeder/45715_4.3_checks_in_dry-run has been reverted:

[dtroeder/45715_4.3_checks_in_dry-run b7ac99773] Bug #47183: don't change hooks in case of scheduled_for_deletion, don't change signature of modify()
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2018-06-22 16:14:19 CEST
Yes, as discussed, the current behaviour is the correct one.

The commit has been reverted. → VERIFIED
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2018-07-04 18:12:21 CEST
UCS@school 4.3 v4 has been released.

https://docs.software-univention.de/changelog-ucsschool-4.3v4-de.html

If this error occurs again, please clone this bug.