Mail Archives: cygwin/2001/07/30/17:38:38
> This is from the Solaris 8 (pretty sure, they just got upgraded) man
> page for chroot-
>
> "The chroot utility causes command to be executed relative
> to newroot. The meaning of any initial slashes (|) in the
> path names is changed to newroot for command and any of
> its child processes."
>
> So / should be chroot-ed to /view/view0, and
> ls /vobs
> is the same as saying
> ls /view/view0/vobs.
> I can't see it any other way. I mean, if
>
> chroot /view/view0
> ls /vobs
>
> gives you
> /vob1
This is CORRECT behaviour! From your quote above, '... for command and any
of its child processes.' If you look at the top of the man-page, it should
say
chroot [OPTION] NEWROOT [COMMAND...]
You are not giving any command, so the following sequence is happening:
1) chroot /view/view0
1a) Do a chroot to /view/view0
1b) Now execute COMMAND (no command specified, so do nothing)
1c) OK, done, exit chrooted environment
2) ls /vobs
2a) show /vob1, because the chroot is no longer in effect!
You need to put: chroot /view/view0 ls /vobs
Or, to have the chroot be in effect for further commands, run a sub-shell on
the chroot line - e.g:
chroot /view/view0 bash
Please bear in mind that my chroot doesn't work (someone else has just
reported the same bug), so I can't test this.
Max.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -