aboutsummaryrefslogtreecommitdiffstats
path: root/test/chroot
diff options
context:
space:
mode:
authorLibravatar Fred Barclay <Fred-Barclay@users.noreply.github.com>2017-05-24 14:38:01 -0500
committerLibravatar Fred Barclay <Fred-Barclay@users.noreply.github.com>2017-05-24 14:38:01 -0500
commit997a93efbdcbbaeed517e0bdc5283e9d8b31f422 (patch)
treecbb47fb1b41ced351501686e3fdf9aaf46b31414 /test/chroot
parentRemove trailing whitespace from platform (diff)
downloadfirejail-997a93efbdcbbaeed517e0bdc5283e9d8b31f422.tar.gz
firejail-997a93efbdcbbaeed517e0bdc5283e9d8b31f422.tar.zst
firejail-997a93efbdcbbaeed517e0bdc5283e9d8b31f422.zip
strip trailing whitespace from test/
Diffstat (limited to 'test/chroot')
-rwxr-xr-xtest/chroot/fs_chroot.exp1
-rwxr-xr-xtest/chroot/unchroot-as-root.exp1
-rw-r--r--test/chroot/unchroot.c16
3 files changed, 8 insertions, 10 deletions
diff --git a/test/chroot/fs_chroot.exp b/test/chroot/fs_chroot.exp
index 2190db359..a071027e5 100755
--- a/test/chroot/fs_chroot.exp
+++ b/test/chroot/fs_chroot.exp
@@ -59,4 +59,3 @@ after 100
59 59
60 60
61puts "all done\n" 61puts "all done\n"
62
diff --git a/test/chroot/unchroot-as-root.exp b/test/chroot/unchroot-as-root.exp
index 9f8a1d784..e4bedd539 100755
--- a/test/chroot/unchroot-as-root.exp
+++ b/test/chroot/unchroot-as-root.exp
@@ -24,4 +24,3 @@ expect {
24after 100 24after 100
25 25
26puts "all done\n" 26puts "all done\n"
27
diff --git a/test/chroot/unchroot.c b/test/chroot/unchroot.c
index 1982e07f3..4919637d6 100644
--- a/test/chroot/unchroot.c
+++ b/test/chroot/unchroot.c
@@ -13,28 +13,28 @@ void die(char *msg) {
13int main(int argc, char *argv[]) 13int main(int argc, char *argv[])
14{ 14{
15 int i; 15 int i;
16 16
17 if (chdir("/") != 0) 17 if (chdir("/") != 0)
18 die("chdir(/)"); 18 die("chdir(/)");
19 19
20 if (mkdir("baz", 0777) != 0) 20 if (mkdir("baz", 0777) != 0)
21 ; //die("mkdir(baz)"); 21 ; //die("mkdir(baz)");
22 22
23 if (chroot("baz") != 0) 23 if (chroot("baz") != 0)
24 die("chroot(baz)"); 24 die("chroot(baz)");
25 25
26 for (i=0; i<50; i++) { 26 for (i=0; i<50; i++) {
27 if (chdir("..") != 0) 27 if (chdir("..") != 0)
28 die("chdir(..)"); 28 die("chdir(..)");
29 } 29 }
30 30
31 if (chroot(".") != 0) 31 if (chroot(".") != 0)
32 die("chroot(.)"); 32 die("chroot(.)");
33 33
34 printf("Exploit seems to work. =)\n"); 34 printf("Exploit seems to work. =)\n");
35 35
36 execl("/bin/bash", "bash", "-i", (char *)0); 36 execl("/bin/bash", "bash", "-i", (char *)0);
37 die("exec bash"); 37 die("exec bash");
38 38
39 exit(0); 39 exit(0);
40} 40}