Mail Archives: cygwin/2001/07/30/21:13:38
IIRC, the rest of the manpage says that chroot will open up a new shell (and not
exit) if no command is given.
I've just tried chroot at home (dated 25 April 2001) and it works, but it
doesn't work at work (which was updated last Friday).
Noel
> 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/
This communication is for informational purposes only. It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan Chase & Co., its
subsidiaries and affiliates.
--
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 -