delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/09/29/03:50:44

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: Thu, 29 Sep 2005 09:50:26 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: Cygwin List <cygwin AT cygwin DOT com>
Subject: Re: bug in rmdir(2)
Message-ID: <20050929075025.GA19713@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: Cygwin List <cygwin AT cygwin DOT com>
References: <092820052226 DOT 6432 DOT 433B18B2000A598D0000192022007358340A050E040D0C079D0A AT comcast DOT net>
Mime-Version: 1.0
In-Reply-To: <092820052226.6432.433B18B2000A598D0000192022007358340A050E040D0C079D0A@comcast.net>
User-Agent: Mutt/1.4.2i

On Sep 28 22:26, Eric Blake wrote:
> > At 04:31 PM 9/28/2005, you wrote:
> > >POSIX requires resolving a filename with a trailing slash as
> > >though . were implicitly present, and requires rmdir(2) to fail
> > >with EINVAL if the final component is '.'.  Therefore, both of
> > >these cases should fail rather than removing the directory:
> > >
> > >$ mkdir a b
> > >$ rmdir a/ b/.
> > >$ ls a b      # Oops, rmdir("a/") and rmdir("b/.") incorrectly succeeded
> > >ls: a: No such file or directory
> > >ls: b: No such file or directory
> > 
> > 
> > But that conflicts with Windows semantics, doesn't it?  If this is important 
> > enough for 'rmdir', I suppose you could patch it to give you the behavior 
> > you describe.  But making Cygwin work this way internally is playing with
> > the already complex path processing code.  I can't see the gain to support 
> > this corner case and slow down everything else.
> 
> The fix to rmdir(2) is easy - check for a trailing / or /. or /..
> before handing the name off to the complex path processing
> code, and fail with EINVAL if so.  rmdir(2) isn't called often
> enough for this to slow down everything else, and there are
> no Windows API calls in this failure mode, and in return you
> get POSIX compliance.

Just a trailing slash is fine, btw.  Try this on any POSIXy system.


Corinna

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

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