Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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: Wed, 24 Aug 2005 09:35:42 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Unable to access forced mounts from /bin/sh Message-ID: <20050824133542.GD21223@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com References: <4309C081 DOT 9030400 AT byu DOT net> <430C7019 DOT 4070307 AT byu DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <430C7019.4070307@byu.net> User-Agent: Mutt/1.5.8i On Wed, Aug 24, 2005 at 07:03:21AM -0600, Eric Blake wrote: >According to Eric Blake on 8/22/2005 6:09 AM: >>>>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. > >Sure enough, on 'cd -L', bash always checks for the existance of the >entire path, then checks for posixly_correct, then tries chdir(); so bash >succeeds where sh fails when an intermediate path name didn't exist. A >patch will be provided in bash-3.0-12 whereby if chdir() can succeed even >though intermediate components don't exist, then bash will allow it even >in posix mode. My understanding of cygwin is that since //, /proc, and >/cygdrive always exist, and /dev has no subdirectories (and in the latest >snapshot, even /dev exists - thanks cgf!), the only time chdir(dir) can >succeed when stat(basename(dir)) fails is with 2-level forced mount points. "/cygdrive" (please notice the quotes and ponder what they might mean), /proc, and /dev now show up in root, regardless of whether a "mkdir" has been done on them but it's not a perfect solution since one can do this: cd / mkdir dev rmdir dev ls dev ls: reading directory dev: No such file or directory ls ... dev ... No matter what you do, "ls /dev" will either show up as a nonexistent or empty directory. Populating the /dev directory is not trivial, unfortunately. You can play similar games "/cygdrive", too, although 'ls "/cygdrive"' will do something useful, at least. cgf -- 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/