www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/04/23/07:13:17

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Fri, 23 Apr 2010 13:12:58 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: PLEASE TEST YOUR FS (was Re: 1.7.1: cvs version built in is unstable)
Message-ID: <20100423111258.GP1845@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20100407083403 DOT GD27428 AT calimero DOT vinschen DOT de> <20100407085343 DOT GY18530 AT calimero DOT vinschen DOT de> <C742AC34C772EC4BAAF642C22E6079D30123F71F32E8 AT NSPEXMBX-A DOT the-lab DOT llnl DOT gov> <20100407170643 DOT GF18530 AT calimero DOT vinschen DOT de> <20100407172659 DOT GH18530 AT calimero DOT vinschen DOT de> <20100422094145 DOT GF1845 AT calimero DOT vinschen DOT de> <8CCC8F85C5F2784387A32FAD835FB4E602DBF139B5 AT server03> <20100422121213 DOT GG1845 AT calimero DOT vinschen DOT de> <20100422175108 DOT GM1845 AT calimero DOT vinschen DOT de> <20100423084543 DOT GC15379 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20100423084543.GC15379@calimero.vinschen.de>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
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

On Apr 23 10:45, Corinna Vinschen wrote:
> On Apr 22 19:51, Corinna Vinschen wrote:
> > On Apr 22 14:12, Corinna Vinschen wrote:
> > > Thank you.   Oh well.  When trying to open the file to check for its
> > > existance, the NT status code is STATUS_OBJECT_NAME_NOT_FOUND which is
> > > equivalent to the POSIX errno ENOENT, "No such file or directory".
> > > 
> > > Only afterwards, when trying to create the file, the status code is
> > > STATUS_OBJECT_NAME_INVALID.  Too late for Cygwin.
> > 
> > I've just applied a patch which is supposed to fix this problem.
> > 
> > The core component which evaluates a file and performs basic checks now
> > handles the case STATUS_OBJECT_NAME_NOT_FOUND specially.  It checks if
> > the filename has leading spaces and/or trailing dots and spaces.  If so,
> > it checks the filesystem.  If it's one of the known FSes with broken
> > (aka DOS-only) path handling, it removes the offending leading spaces
> > and trailing dots and spaces and tries again.
> > 
> > So this:
> > 
> >   $ touch "  abc    ...   "
> > 
> > will create the file
> > 
> >   "  abc    ...   "
> > 
> > for instance on NTFS or FAT, but it will create the file
> > 
> >   "abc"
> > 
> > on NetApp, NWFS and other filesystems recognized as CIFS (but not Samba).

I didn't like this solution at all.  I just applied another patch which
handles that differently.  Instead of stripping the leading spaces and
trailing dots and spaces, they now get converted the same way as
described in
http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-specialchars

So the offending dots and spaces are converted into the UNICODE private
use area instead, and transparently converted back to dots and spaces
when accessing them via Cygwin.  This allows to keep the filenames
unchanged from the user's point of view.  The file

  "  abc    ...   "

is *still* the file

  "  abc    ...   "

even on the broken filesystems.

Again I tested this change on NTFS with a little tweak to the code.  If
you NetApp and NWFS users please test the next developer's snapshot (the
next one after 2010-04-22), I would be most grateful.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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