www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/22/10:49:24

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
Date: Mon, 22 Aug 2005 10:48:02 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Eric Blake <ebb9 AT byu DOT net>
cc: cygwin AT cygwin DOT com
Subject: Re: Unable to access forced mounts from /bin/sh
In-Reply-To: <4309C081.9030400@byu.net>
Message-ID: <Pine.GSO.4.61.0508221043460.8277@slinky.cs.nyu.edu>
References: <Pine DOT GSO DOT 4 DOT 61 DOT 0508210147050 DOT 16057 AT slinky DOT cs DOT nyu DOT edu> <4309C081 DOT 9030400 AT byu DOT net>
MIME-Version: 1.0

On Mon, 22 Aug 2005, Eric Blake wrote:

> According to Igor Pechtchanski on 8/20/2005 11:57 PM:
> > Here's something weird.  I don't know whether this is a problem with the
> > latest Cygwin, or bash:
>
> I don't know if 2-level forced directories would/should ever work.  If /a
> doesn't exist, then should a forced mount point at /a/b really be
> simulating the existance of both a and b?  Would /a then be treated as a
> read-only file system virtual directory until such time as you actually
> 'mkdir /a'?  Maybe a better solution is to make 'mount -f' require that
> 'dirname path' exist, so that only 'basename path' is forced.

Sounds right.  <http://cygwin.com/acronyms/#SHTDI>, of course...

> On the other hand, what if the user does:
> $ mkdir /a
> $ mount -u -f c: /a/b
> $ rmdir /a
>
> This will take some thought and planning for cygwin1.dll and mount(1) to
> get sane behavior in all cases.  Maybe the best solution for this case is
> to have rmdir(2) to return EBUSY or ENOTEMPTY if the directory being
> removed is currently hosting a forced mountpoint.

Another problem is that if one has a mount that points to a non-existent
directory, rmdir will actually resolve to / (with the obvious disastrous
circumstances)...  Again, long standing behavior that someone will have to
fix...

> > Huh?  Strace shows that sh fails when trying to stat /a.  Does this,
> > perhaps, have something to do with bash switching to POSIX mode when
> > invoked as "sh"?
>
> Yes it does.  I'll have to look into bash POSIX mode further, and decide
> why cd only stat's intermediate paths in POSIX mode, to see if it warrants
> a patch to bash.

cd will actually stat all partial paths up to the specified one.  Your
first suggestion (disallow multiple levels of forced mounts) is probably a
better solution, anyway.

Thanks for looking into this.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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