aboutsummaryrefslogtreecommitdiffstats
path: root/test/chroot/chroot.sh
blob: a1fb3ee38d7db3b09439d03a83368584480ee2a5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
# This file is part of Firejail project
# Copyright (C) 2014-2023 Firejail Authors
# License GPL v2

export MALLOC_CHECK_=3
export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
export LC_ALL=C

rm -f unchroot
gcc -o unchroot unchroot.c
sudo ./configure

echo "TESTING: chroot disabled (test/chroot/fs_chroot_disabled.exp)"
./fs_chroot_disabled.exp

sudo sed -i s/"# chroot no"/"chroot yes"/g /etc/firejail/firejail.config

echo "TESTING: chroot (test/chroot/fs_chroot.exp)"
./fs_chroot.exp

echo "TESTING: unchroot as root (test/chroot/unchroot-as-root.exp)"
sudo ./unchroot-as-root.exp

rm -f unchroot