delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/07/30/17:38: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
Message-ID: <008901c11938$609dc5a0$5800000a@max>
From: "Max Bowsher" <max AT bowshernet DOT freeserve DOT co DOT uk>
To: <cygwin AT cygwin DOT com>
References: <4 DOT 3 DOT 1 DOT 2 DOT 20010730115430 DOT 0226dbb8 AT pop DOT ma DOT ultranet DOT com> <3B658BCA DOT CFE748A3 AT cportcorp DOT com>
Subject: Re: chroot and mount question
Date: Mon, 30 Jul 2001 21:43:33 +0100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200

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


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