Re:The origins of chroot()
by xj9 on Wednesday September 02, 2015 @03:54PM
(#10161525)
You don't. A correct `chroot()` implementation shouldn't let you access paths that aren't below the new `/`.
[ Parent
| on HN ]
That is indeed the modern behaviour of chroot. It is not clear that the "original implementation" shown in the article shares that property, though.
EDIT: That's not to say it doesn't prevent that behaviour. If the usual code to prevent you ..ing above the root checks against u.u_rdir instead of /, it might well work as modern implementations do.
My recollection of chroot in the late '90s is that it didn't provide a jail.