From 65c14a0d0a9712d0579ef3ce0c004bae83e51ad9 Mon Sep 17 00:00:00 2001 From: Maciej Borzecki Date: Wed, 27 Nov 2019 11:04:00 +0100 Subject: [PATCH] tests/lib/prepare: drop workarounds for rpmbuild rewriting /bin/sh Drop the workaround for rpmbuild rewriting /bin/sh to /usr/bin/sh. The snap-confine device cgroup setup would call snap-device-helper after pivoting to the snap mount namespace. This used to fail on Fedora because of the mangling done by rpm packaging that changes /bin/sh to /usr/bin/sh. In which, case we would try to run snap-device-helper using an interpreter at /usr/bin/sh that does not exist within the snap mount ns. The downstream packaging defined macros that prevented this scenario. Since #7049, snap-confine calls snap-device-helper before pivoting to the snap mount namespace, thus the host interpreter is still visible at the correct path. Signed-off-by: Maciej Borzecki --- tests/lib/prepare.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/lib/prepare.sh b/tests/lib/prepare.sh index 0fedefd8cae..f4ce3899f6e 100755 --- a/tests/lib/prepare.sh +++ b/tests/lib/prepare.sh @@ -130,12 +130,6 @@ update_core_snap_for_classic_reexec() { rm squashfs-root/usr/lib/snapd/* squashfs-root/usr/bin/snap # and copy in the current libexec cp -a "$LIBEXECDIR"/snapd/* squashfs-root/usr/lib/snapd/ - case "$SPREAD_SYSTEM" in - fedora-*|centos-*|amazon-*) - # RPM can rewrite shebang to #!/usr/bin/sh - sed -i -e '1 s;#!/usr/bin/sh;#!/bin/sh;' squashfs-root/usr/lib/snapd/snap-device-helper - ;; - esac # also the binaries themselves cp -a /usr/bin/snap squashfs-root/usr/bin/ # make sure bin/snapctl is a symlink to lib/