Skip to content

Commit

Permalink
tests/lib/prepare: drop workarounds for rpmbuild rewriting /bin/sh
Browse files Browse the repository at this point in the history
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 <maciej.zenon.borzecki@canonical.com>
  • Loading branch information
bboozzoo committed Nov 27, 2019
1 parent 28a3871 commit 65c14a0
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions tests/lib/prepare.sh
Expand Up @@ -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/
Expand Down

0 comments on commit 65c14a0

Please sign in to comment.