delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/12/01/18:44:17

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-Id: <5.1.0.14.2.20021201153836.0274b6e0@pop3.cris.com>
X-Sender: rrschulz AT pop3 DOT cris DOT com
Date: Sun, 01 Dec 2002 15:45:11 -0800
To: cygwin AT cygwin DOT com
From: Randall R Schulz <rrschulz AT cris DOT com>
Subject: RE: problem with chroot causing Cygwin to get confused about
the root directory
In-Reply-To: <83040F98B407E6428FEC18AC720F5D73E5010E@exchange.tropicnetw
orks.com>
Mime-Version: 1.0

Rolf, Chris,

Chroot is a very big club, indeed. Unless you've set up a separate 
execution environment (including binaries, libraries, configuration or 
auxiliary files such as those ordinarily located in /etc or /lib, etc.), 
very little will work after a successul "chroot" call.

Note that "chroot" is not a BASH built-in, but rather an executable 
command. According to the man page, it uses $SHELL (default "/bin/sh") to 
start up an interactive shell if no command is specified. Thus the 
diagnostic you report, Rolf, is to be expected if your SHELL environment is 
not set or is set to "/bin/sh." Once the root of the file system is set to 
the current directory, names like "/bin/sh" are unlikely to exist unless 
you've set things up to include them.

One place I see this done routinely is in public access FTP servers.

Randall Schulz
Mountain View, CA USA


At 15:32 2002-12-01, Rolf Campbell wrote:
>When I try "chroot ." in bash I get:
>$ chroot .
>chroot: cannot execute /bin/sh: No such file or directory
>
> > -----Original Message-----
> > From: Chris January [mailto:chris AT atomice DOT net]
> > Sent: Sunday, December 01, 2002 5:08 PM
> > To: Cygwin AT Cygwin DOT Com
> > Subject: RE: problem with chroot causing Cygwin to get
> > confused about the root directory
> >
> >
> > > I'm having a problem with chroot - see the following strace:
> >
> > <--snip-->
> >
> > > At the start of the strace chroot (".") has been called; it succeeds
> > > at time 63935. (The same problem occurs with chroot(<full path to
> > > rootfs>) as well).
> > > Then chdir ("/") is called at time 64000. The result of
> > > conv_to_posix_path at time 2652 should be '/', but is instead
> > > /cygdrive/c/... I'll look at the Cygwin source, but has anyone else
> > > any ideas as I suspect it may take me some time to track this down.
> >
> > In the same vain, chroot . in bash goes into an infinite loop.
> >
> > Chris


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