delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/07/30/21:13:38

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
X-Lotus-FromDomain: JPMORGAN AT SMTP
From: "Noel L Yap" <yap_noel AT jpmorgan DOT com>
To: max AT bowshernet DOT freeserve DOT co DOT uk
cc: cygwin AT cygwin DOT com
Message-ID: <85256A9A.0005EA2F.00@nyc-ntgw-n01.ny.jpmorgan.com>
Date: Mon, 30 Jul 2001 21:04:38 -0400
Subject: Re: chroot and mount question and chroot bug
Mime-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019