This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [list] RE: problem with chroot causing Cygwin to get confused about the root directory


When an exec(2) system call fails do to a file format problem (ENOEXEC) as opposed to a file-not-found error (ENOENT) or a permission error (EPERM), the fallback action taken by the shell is to interpret the file as a script.

One could argue that the shell should be a little more intelligent about dealing with the failure to exec a shell to interpret the "script."

Randall Schulz
Mountain View, CA USA

At 16:18 2002-12-01, Chris January wrote:
> > > 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.

^^^ this second one's solved (ish)

I'm running it in a directory where /bin/sh exists and /bin/sh is a Linux
ELF file (because I'm playing with Line). when I run chroot ., Cygwin tries
to run /bin/sh, but for some reason thinks it's a script. Scripts are run
with /bin/sh, so off Cygwin goes to look for /bin/ nauseum.


Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]