Bug 53326 - postinst of package ucs-school-import overwrites certain UCRV
postinst of package ucs-school-import overwrites certain UCRV
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 4.4
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v9-errata
Assigned To: Daniel Tröder
Tobias Wenzel
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-05-25 10:34 CEST by Dirk Ahrnke
Modified: 2021-07-01 12:09 CEST (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?: 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):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Ahrnke univentionstaff 2021-05-25 10:34:44 CEST
The postinst of ucs-school-import is resetting certain UCRV on every update to defaults. 
Example: ucsschool/import/purge-expired-users/cron
As a result the cronjob /usr/share/ucs-school-import/scripts/ucs-school-purge-expired-users will be reactivated even in environments where it should not run.
Comment 1 Daniel Tröder univentionstaff 2021-05-25 11:58:58 CEST
Fixed in branch dtroeder/53326_purge-expired-users_cron:

[49437ce18] Bug #53326: deactivation of cron job survives update

If the UCRV is now set to an empty value (not unset!), then the cronjob will be deatived and that will survive an update.
Comment 2 Tobias Wenzel univentionstaff 2021-06-17 15:51:10 CEST
QA: All OK, rebase, merge & build

code: OK
ucr-v description: OK

manual QA:

UCS: 4.4-8 errata993
Installed: cups=2.2.1 samba4=4.10 squid=3.5 ucsschool=4.4 v9

ucr set ucsschool/import/purge-expired-users/cron=""
update 
→ ucr get ucsschool/import/purge-expired-users/cron==""
&  /etc/cron.d/ucs-school-import is empty as expected


> The postinst of ucs-school-import is resetting certain UCRV on every update to defaults. 
As far as I see only ucsschool/import/purge-expired-users/cron was set with =, the rest was set with ?, i.e. the variable should not have been overwritten in the postinst → OK
Comment 3 Toni Röhmeyer univentionstaff 2021-06-24 09:22:21 CEST
Merged dtroeder/53326_purge-expired-users_cron to 4.4 with

534034e36 Bug #53326: added advisory
56247b28c Bug #53326: added changelog entry
70e0975af Bug #53326: Merge branch 'dtroeder/53326_purge-expired-users_cron' into 4.4
06aef0de2 Bug #53326: deactivation of cron job survives update


Successful build:

Package: ucs-school-import
Version: 17.0.68A~4.4.0.202106240912
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 4 Toni Röhmeyer univentionstaff 2021-06-24 09:49:35 CEST
Sorry, I mistakenly removed the print brackets during the merge.

I added them back again with

26b1d9065 Bug #53326: update yaml
4d9f4af4b Bug #53326: add print brackets


Package: ucs-school-import
Version: 17.0.69A~4.4.0.202106240947
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 5 Tobias Wenzel univentionstaff 2021-06-24 10:15:37 CEST
QA:
Thanks for the fix

changelog OK
yaml OK
merge OK

waiting for jenkins before verify
Comment 6 Tobias Wenzel univentionstaff 2021-06-25 08:40:01 CEST
jenkins is happy -> verify
Comment 7 Tobias Wenzel univentionstaff 2021-07-01 12:09:31 CEST
Errata updates for UCS@school 4.4 v9 have been released.

https://docs.software-univention.de/changelog-ucsschool-4.4v9-de.html

If this error occurs again, please clone this bug.