Bug 53336 - preup.sh do not test if testparm is installed and this lead to wrong test result (and denial of update)
Summary: preup.sh do not test if testparm is installed and this lead to wrong test res...
Status: CLOSED FIXED
Alias: None
Product: UCS
Classification: Unclassified
Component: Samba4
Version: UCS 4.4
Hardware: Other Linux
: P5 normal
Target Milestone: UCS 5.0-0-errata
Assignee: Jürn Brodersen
QA Contact: Florian Best
URL:
Keywords:
Depends on:
Blocks: 53212
  Show dependency treegraph
 
Reported: 2021-05-27 10:30 CEST by Dirk Schnick
Modified: 2021-09-16 16:06 CEST (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key 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.114
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2021052721000059
Bug group (optional):
Customer ID:
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Schnick univentionstaff 2021-05-27 10:30:13 CEST
The problem occured in a customer environment on a replica without samba installation, may occur also in other scenarios.
The problem seems to be, that the preup.sh always checks if schannel is activated and this test needs testparm. On a machine without samba testparm is not on the system and the test fails and the update is denied.



+++ This bug was initially created as a clone of Bug #49898 +++

At some point we should update to the next Samba release.

This bug collects things that we should keep in mind before doing that.

First point on this list: Adjust preup.sh to run testparm to check for removed smb.conf options like "server schannel = auto" ( see https://bugzilla.samba.org/show_bug.cgi?id=13464 ). If an option like that is found, the customer should be warned and asked for confirmation before updating.
Comment 1 Florian Best univentionstaff 2021-05-27 10:45:45 CEST
The preup.sh shows:
> The system can not be updated to UCS 5.0 due to the following reasons:samba_server_schannel
> :
> WARNING: Samba is configured with "server schannel = ",
>          This is extremely dangerous, see https://www.samba.org/samba/security/CVE-2020-1472.html
>          Please take care to change this back to "yes" before updating.
> 
> Error: Please check "/var/log/univention/updater.log" for details.
> ERROR: update failed. Please check /var/log/univention/updater.log
Comment 3 Jürn Brodersen univentionstaff 2021-05-31 10:25:25 CEST
WIP on "juern/preupsh"
[juern/preupsh 55d2b04acf] Bug #53336: check if testparm is executable

TODO: Check how to deploy a new check.sh and preup.sh
Comment 4 Jürn Brodersen univentionstaff 2021-05-31 15:47:44 CEST
@QA
"apt remove samba-common-bin" to remove testparm
Comment 5 Jürn Brodersen univentionstaff 2021-05-31 17:56:53 CEST
[5.0-0 d0025f401d] Bug #53336: check if testparm is executable

preup.sh and preup.sh.gpg have been copied to
apt.knut.univention.de (http://apt.knut.univention.de/dists/ucs500/)
updates-test.software-univention.de (https://updates-test.software-univention.de/dists/ucs500/)

Please reopen if ready for copy to production mirror
Comment 6 Jürn Brodersen univentionstaff 2021-05-31 18:00:38 CEST
pre-update-checks-5.0-0 is only available on apt.knut.univention.de (updates-test has no download folder)
http://apt.knut.univention.de/download/univention-update-checks/
Comment 7 Florian Best univentionstaff 2021-05-31 18:05:23 CEST
(In reply to Jürn Brodersen from comment #5)
> Please reopen if ready for copy to production mirror
OK: check for testparm works
Comment 8 Jürn Brodersen univentionstaff 2021-05-31 18:46:30 CEST
Copied preup.sh & preup.sh.gpg to production download server:
https://updates.software-univention.de/dists/ucs500/

Copied pre-update-checks-5.0-0 & pre-update-checks-5.0-0.gpg to production download server:
https://updates.software-univention.de/download/univention-update-checks/

I did a quick check:
upgrade can be started and new srcipt is used.

and this snippet from the release notes:
"""
# download
curl -OOf https://updates.software-univention.de/download/univention-update-checks/pre-update-checks-5.0-0{.gpg,}

# verify and run script
apt-key verify pre-update-checks-5.0-0{.gpg,} &&
  bash pre-update-checks-5.0-0
"""
Comment 9 Florian Best univentionstaff 2021-06-01 10:27:25 CEST
OK