Freaky as it seems, you can on Linux¹ (Red Hat.)
From chroot(2):
Note that this call does not change the current working directory, so that `.' can be outside the tree rooted at `/'. In particular, the super-user can escape from a `chroot jail' by doing `mkdir foo; chroot foo; cd ..'.
I've confirmed that I can do it in perl with another chroot() to ./../../ (with enough ..s to get me to the real root from the CWD.) I guess "." isn't just symbolic?
Ick.
Thankfully, that's not portable. Other systems are sane.
1. I figured I'd look at the manpage to see if it said "you can't do that" and much to my surprise...
-sauoq "My two cents aren't worth a dime.";
In reply to Re: Re: exiting a chroot environment
by sauoq
in thread exiting a chroot environment
by storri
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |