diff options
Diffstat (limited to 'test/chroot/configure')
-rwxr-xr-x | test/chroot/configure | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/chroot/configure b/test/chroot/configure index af511f9c7..f7bfedf10 100755 --- a/test/chroot/configure +++ b/test/chroot/configure | |||
@@ -8,7 +8,7 @@ ROOTDIR="/tmp/chroot" # default chroot directory | |||
8 | DEFAULT_FILES="/bin/bash /bin/sh " # basic chroot files | 8 | DEFAULT_FILES="/bin/bash /bin/sh " # basic chroot files |
9 | DEFAULT_FILES+="/etc/passwd /etc/nsswitch.conf /etc/group " | 9 | DEFAULT_FILES+="/etc/passwd /etc/nsswitch.conf /etc/group " |
10 | DEFAULT_FILES+=`find /lib -name libnss*` # files required by glibc | 10 | DEFAULT_FILES+=`find /lib -name libnss*` # files required by glibc |
11 | DEFAULT_FILES+=" /bin/cp /bin/ls /bin/cat /bin/ps /bin/netstat /bin/ping /usr/bin/touch /bin/grep" | 11 | DEFAULT_FILES+=" /bin/cp /bin/ls /bin/cat /bin/ps /bin/ping /usr/bin/touch /bin/grep" |
12 | 12 | ||
13 | rm -fr $ROOTDIR | 13 | rm -fr $ROOTDIR |
14 | mkdir -p $ROOTDIR/{root,bin,lib,lib64,usr,home,etc,dev/shm,tmp,var/run,var/tmp,var/lock,var/log,proc,sys} | 14 | mkdir -p $ROOTDIR/{root,bin,lib,lib64,usr,home,etc,dev/shm,tmp,var/run,var/tmp,var/lock,var/log,proc,sys} |
@@ -18,6 +18,10 @@ mkdir -p $ROOTDIR/home/netblue/.config/firejail | |||
18 | chown netblue:netblue $ROOTDIR/home/netblue | 18 | chown netblue:netblue $ROOTDIR/home/netblue |
19 | chown netblue:netblue $ROOTDIR/home/netblue/.config | 19 | chown netblue:netblue $ROOTDIR/home/netblue/.config |
20 | cp /home/netblue/.Xauthority $ROOTDIR/home/netblue/. | 20 | cp /home/netblue/.Xauthority $ROOTDIR/home/netblue/. |
21 | mkdir -p $ROOTDIR/home/runner/.config/firejail | ||
22 | chown runner:runner $ROOTDIR/home/runner | ||
23 | chown runner:runner $ROOTDIR/home/runner/.config | ||
24 | |||
21 | cp -a /etc/skel $ROOTDIR/etc/. | 25 | cp -a /etc/skel $ROOTDIR/etc/. |
22 | mkdir $ROOTDIR/home/someotheruser | 26 | mkdir $ROOTDIR/home/someotheruser |
23 | mkdir $ROOTDIR/boot | 27 | mkdir $ROOTDIR/boot |
@@ -27,8 +31,6 @@ cp /etc/group $ROOTDIR/etc/. | |||
27 | cp /etc/hosts $ROOTDIR/etc/. | 31 | cp /etc/hosts $ROOTDIR/etc/. |
28 | cp /etc/hostname $ROOTDIR/etc/. | 32 | cp /etc/hostname $ROOTDIR/etc/. |
29 | mkdir -p $ROOTDIR/usr/lib/x86_64-linux-gnu | 33 | mkdir -p $ROOTDIR/usr/lib/x86_64-linux-gnu |
30 | cp -a /usr/lib/x86_64-linux-gnu/openssl-1.0.0 $ROOTDIR/usr/lib/x86_64-linux-gnu/. | ||
31 | cp -a /usr/lib/ssl $ROOTDIR/usr/lib/. | ||
32 | touch $ROOTDIR/var/log/syslog | 34 | touch $ROOTDIR/var/log/syslog |
33 | touch $ROOTDIR/var/tmp/somefile | 35 | touch $ROOTDIR/var/tmp/somefile |
34 | SORTED=`for FILE in $* $DEFAULT_FILES; do echo " $FILE "; ldd $FILE | grep -v dynamic | cut -d " " -f 3; done | sort -u` | 36 | SORTED=`for FILE in $* $DEFAULT_FILES; do echo " $FILE "; ldd $FILE | grep -v dynamic | cut -d " " -f 3; done | sort -u` |
@@ -41,7 +43,7 @@ cp --parents /lib/ld-linux.so.2 $ROOTDIR | |||
41 | cp unchroot $ROOTDIR/. | 43 | cp unchroot $ROOTDIR/. |
42 | touch $ROOTDIR/this-is-my-chroot | 44 | touch $ROOTDIR/this-is-my-chroot |
43 | 45 | ||
44 | cd $ROOTDIR; find . | 46 | cd $ROOTDIR; |
45 | mkdir -p usr/lib/firejail/ | 47 | mkdir -p usr/lib/firejail/ |
46 | cp /usr/lib/firejail/libtrace.so usr/lib/firejail/. | 48 | cp /usr/lib/firejail/libtrace.so usr/lib/firejail/. |
47 | 49 | ||