chroot bug, & Re: Ideas for v2.1

Elliot Lee (sopwith@redhat.com)
Wed, 12 Jun 1996 15:10:30 -0400 (EDT)


On Wed, 12 Jun 1996, Hasdi R Hashim wrote:

> Or make /dev a pseudo filesystem. :)
>
> (I was running out of inodes! Thank goodness now /dev doesn't use any!) (Do I
> have so-and-so installed? Oh yeah! it is listed in /dev!) (Ack! The driver
> permissions in /dev should last after boot, I'm gonna rework my /etv/devtab!)
> (see ma? my boot disk doesn't need /dev entries anymore!)

I like the idea. However...
What about chroot environments and such, where one needs to put in a few
critical device files such as /dev/zero, but doesn't want to give people
access to /dev/hda ;)?

Speaking of chroot, I believe I have found a bug in the chroot mechanism.
Not being a kernel hacker myself, I couldn't tell you where it can be
found & solved, but here is an example of it:

/www is a chroot tree. It has all the libs and everything for a chroot
environment.

If I 'cd /www; chroot . bin/bash', it works as expected.

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 ;-)

\\\| Elliot Lee |\\\ || "Claim to fame":
\\\| Red Hat Software |\\\ || Live in only town in the
\\\| Webmaster www.redhat.com, |\\\ || USA with an unlisted ZIP
\\\| Programmer, etc. |\\\ || code.