** Description changed: [Impact] The samba-common-bin postinst script relies on the presence of the /run/samba directory. This directory will not be available unless samba- common-bin is installed right after samba-common, whose postinst script creates /run/samba. Although samba-common-bin Depends on samba-common, reducing the risk of an user hitting the described bug, samba-common only Recommends samba-common-bin, making the following case possible: The user installs samba-common. Then, the user removes samba-common-bin. Then the user reboots the system (which removes /run/samba created during samba-common installation). Finally, the user installs samba- common-bin, which results in a postinst script failure. - - For the case described above, restarting the system and reconfiguring - (or running the installation again) should fix the issue, since the - samba-common-bin systemd-tmpfiles configuration would now create - /run/samba (running systemd-tmpfiles --create for the samba-common-bin - would also work). - - The proposed patch cherry picks commit 0c3b205 from Debian to run - systemd-tempfiles before the testparm call and applies further changes - so the #DEBHELPER# tag can be expanded using debhelper compat 12. - Aditionally, it introduces an autopkgtest test case for the fixed issue. [Test Plan] To reproduce the issue, run the following steps: # apt install samba-common # apt remove samba-common-bin Reboot the system and verify that the /run/samba directory no longer exists Run # apt install samba-common-bin This command should exit with a non-zero status, as described in the original bug report. After applying the proposed changes, performing the steps above should result in a successful exit status for the last command. [Where problems could occur] There are 2 changes to be considered here. The one to d/rules and the one to d/samba-common-bin.postinst The change to d/rules makes the #DEBHELPER# tag, moved in the change to d/samba-common-bin.postinst to actually generate code. - The generated code is making a call to systemd-tmpfiles, which is - provided by the systemd package. However, samba-common-bin does not - deppend on systemd. - - Here is the generated snippet: - - # Automatically added by dh_installsystemd/12.10ubuntu1 - if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then - # In case this system is running systemd, we need to ensure that all - # necessary tmpfiles (if any) are created before starting. - if [ -d /run/systemd/system ] ; then - systemd-tmpfiles --create samba.conf >/dev/null || true - fi - fi - # End automatically added section - - The snipped showed above does check for evidence that systemd-tmpfiles - is available in the system, although it does not make such check - directly. However, in case /run/systemd/system is available and systemd- - tmpfiles is not, the postinst script will not fail at that point. Still, - if the systemd-tmpfiles command does not run, the issue this SRU is - fixing will still manifest itself under the described conditions (which - is true for hirsute, impish, and Debian stable as well). + Still, if the systemd-tmpfiles command does not run (e.g., there is no + systemd available in the system), the issue this SRU is fixing will + still manifest itself under the described conditions (which is true for + hirsute, impish, and Debian stable as well). [Other Info] This issue was already fixed in Debian unstable and, consequently, in Ubuntu hirsute and impish. [Original message] ProblemType: Package DistroRelease: Ubuntu 20.04 Package: samba-common-bin 2:4.11.6+dfsg-0ubuntu1.6 ProcVersionSignature: Ubuntu 5.4.0-54.60-generic 5.4.65 Uname: Linux 5.4.0-54-generic x86_64 ApportVersion: 2.20.11-0ubuntu27.12 Architecture: amd64 CasperMD5CheckResult: skip Date: Tue Nov 24 07:17:34 2020 DistributionChannelDescriptor: # This is the distribution channel descriptor for the OEM CDs # For more information see http://wiki.ubuntu.com/DistributionChannelDescriptor canonical-oem-somerville-bionic-amd64-20180608-47+loki-n3-v3-whl+X32 ErrorMessage: o subprocesso instalado, do pacote samba-common-bin, o script post-installation retornou erro do status de saída 1 InstallationDate: Installed on 2020-11-12 (11 days ago) InstallationMedia: Ubuntu 18.04 "Bionic" - Build amd64 LIVE Binary 20180608-09:38 Python3Details: /usr/bin/python3.8, Python 3.8.5, python3-minimal, 3.8.2-0ubuntu2 PythonDetails: /usr/bin/python2.7, Python 2.7.18, python-is-python2, 2.7.17-4 RelatedPackageVersions: dpkg 1.19.7ubuntu3 apt 2.0.2ubuntu0.1 SambaClientRegression: Yes SourcePackage: samba Title: package samba-common-bin 2:4.11.6+dfsg-0ubuntu1.6 failed to install/upgrade: o subprocesso instalado, do pacote samba-common-bin, o script post-installation retornou erro do status de saída 1 UpgradeStatus: Upgraded to focal on 2020-11-21 (3 days ago)
-- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1905387 Title: samba-common-bin should call systemd-tmpfiles before testparm To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1905387/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
