On Thu, Sep 27, 2007 at 02:01:37AM +0200, Adrian Bunk wrote:> <-- snip -->> > Look, when chroot was being designed, I think they intended that even root > should be unable to get out. They went so far as to say that dot-dot > wouldn't let you out; and it doesn't.> > <-- snip -->> > You were clearly saying that whom you call "they" were the people who > designed chroot. And it was you who was claiming in this statement that> "they" said it.> > The OpenBSD manpage you quoted in this thread states chroot() was added > in 4.2BSD, and 4.2BSD was released in 1983.> > You should therefore either bring a source where the people who designed > chroot() in 1983 or earlier are stating what you claim they said or > admit that you were talking utter bullshit.

chroot() is present in v7, thank you very much. /usr/sys/sys/sys4.c has

chdir(){ chdirec(&u.u_cdir);}chroot(){ if (suser()) chdirec(&u.u_rdir);}and back then it didn't stop lookups by .. at all - u_rdir is only usedin the beginning of namei() (when pathname starts with /), plus the obviousrefcounting in exit()/newproc(). So give me a break - back when it hadbeen introduced, it didn't do anything jail-like _at_ _all_.

with spectaculary lousy commit message ("lint and a minor fixed") bywnj. Feel free to ask Bill Joy WTF he had intended. At a guess,more consistent behaviour in chrooted environment (i.e. pathnameresolution looking as if the subtree had been everything).