[lkml]   [1996]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: chroot bug, & Re: Ideas for v2.1
In message <4pnvmq$>,Bernd Eckenfels writes:
> Elliot Lee ( wrote:
> : If, however, I 'cd /; chroot /www /bin/bash', when bash starts up, it is
> : in the _REAL_ root directory, and I can look at files and such in this
> : directory with ls, etc... To make it go to the changed root, I must do a
> : 'cd /' under the chroot shell...
> :
> : Hope someone can make sense of this ;-)
> This is the normal behaviour,

No it isn't.
The man page for chroot on a SysV or BSD system states:
chroot causes the given command to be executed relative to
the new root. The meaning of any initial slashes (/) in the
pathnames is changed for the command and any of its child
processes to newroot. Furthermore, upon execution, the
initial working directory is newroot.

chroot(8) is broken if it doesn't leave you in newroot.

> since chroot(2) doesnt change the CWD, and
> chroot(8) doesnt do it eighter. Well, I guess it should be mentioned in the
> man-page.

No, the behaviour should be corrected. Having a command with the same name
and different behaviour is a recipe for disaster :-(


Tim Wright, Worldwide Technical Services, | Email:
Sequent Computer Systems Inc., 15450, |
SW Koll Parkway, Beaverton, Oregon 97006 | Phone: +1-503-578-3822
"Nobody ever said I was charming, they said "Rimmer, you're a git!"" RD VI

 \ /
  Last update: 2005-03-22 13:37    [W:0.045 / U:4.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site