diff options
author | Iain Lane <iainl@gnome.org> | 2018-09-28 11:39:47 +0100 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-09-28 15:43:16 +0000 |
commit | 0148dd34bb7eff4935d5218d04d78b027588cc4c (patch) | |
tree | 19c6cf3b3936f7fb005157aa9a2c969709700e9b | |
parent | e7b517f40956a153972fd61a2c6da1140f52990b (diff) | |
download | bubblewrap-0148dd34bb7eff4935d5218d04d78b027588cc4c.tar.gz |
tests: Handle systems without merged-/usr
For the non-suid case, we were assuming that the host system would have
merged /usr (e.g. /bin -> /usr/bin). This isn't yet the case for all
distros, so let's handle both.
Closes: #290
Approved by: smcv
-rwxr-xr-x | tests/test-run.sh | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/tests/test-run.sh b/tests/test-run.sh index c010a34..e68036d 100755 --- a/tests/test-run.sh +++ b/tests/test-run.sh @@ -50,15 +50,28 @@ if ${is_uidzero} || test -x `dirname $UNREADABLE`; then fi # https://github.com/projectatomic/bubblewrap/issues/217 -BWRAP_RO_HOST_ARGS="--ro-bind /usr /usr - --ro-bind /etc /etc - --dir /var/tmp - --symlink usr/lib /lib - --symlink usr/lib64 /lib64 - --symlink usr/bin /bin - --symlink usr/sbin /sbin - --proc /proc - --dev /dev" +# are we on a merged-/usr system? +if [ /lib -ef /usr/lib ]; then + BWRAP_RO_HOST_ARGS="--ro-bind /usr /usr + --ro-bind /etc /etc + --dir /var/tmp + --symlink usr/lib /lib + --symlink usr/lib64 /lib64 + --symlink usr/bin /bin + --symlink usr/sbin /sbin + --proc /proc + --dev /dev" +else + BWRAP_RO_HOST_ARGS="--ro-bind /usr /usr + --ro-bind /etc /etc + --ro-bind /bin /bin + --ro-bind /lib /lib + --ro-bind-try /lib64 /lib64 + --ro-bind /sbin /sbin + --dir /var/tmp + --proc /proc + --dev /dev" +fi # Default arg, bind whole host fs to /, tmpfs on /tmp RUN="${BWRAP} --bind / / --tmpfs /tmp" |