delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/10/25/21:41:51

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Sat, 25 Oct 2003 21:41:26 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
Subject: Re: 1.5.1: can't open files beginning with "..."
In-Reply-To: <20031025221849.GQ1653@cygbert.vinschen.de>
Message-ID: <Pine.GSO.4.56.0310251936540.11370@slinky.cs.nyu.edu>
References: <16281 DOT 6930 DOT 564000 DOT 468376 AT gargle DOT gargle DOT HOWL> <bnbr3c$44k$1 AT sea DOT gmane DOT org>
<Pine DOT CYG DOT 4 DOT 58 DOT 0310242348530 DOT 1436 AT mordor> <20031025165210 DOT GM1653 AT cygbert DOT vinschen DOT de>
<Pine DOT CYG DOT 4 DOT 58 DOT 0310252255510 DOT 1524 AT mordor> <20031025221849 DOT GQ1653 AT cygbert DOT vinschen DOT de>
Importance: Normal
MIME-Version: 1.0

On Sun, 26 Oct 2003, Corinna Vinschen wrote:

> On Sat, Oct 25, 2003 at 10:58:10PM +0200, Pavel Tsekov wrote:
>
> > On Sat, 25 Oct 2003, Corinna Vinschen wrote:
> >
> > > On Sat, Oct 25, 2003 at 12:04:14AM +0200, Pavel Tsekov wrote:
> > > > > Chris Moore wrote:
> > > > > > I have a file on my PC called "...foo.txt".
> > > >
> > > > This does work, but Cygwin's path handling code understands
> > > > only ".." and "." . If it get three dots in a raw and they
> > > > appear before the last '/' char, Cygwin returns ENOENT.
> > >
> > > Fixed in CVS now.
> >
> > Does it fix the following:
> >
> > Administrator AT mordor ~
> > $ cd /usr/bin../
>
> No, it fixes the more than two leading dots problem.  The above is
> a genuin windows problem as you noted in your previous mail.  I don't
> know how to fix this without noticeably slowing down the path conv
> routine.
>
> Corinna

That's what managed mode would be perfect for.  It would need something
like the patch below:

Index: winsup/cygwin/path.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/path.cc,v
retrieving revision 1.277
diff -u -p -r1.277 path.cc
--- winsup/cygwin/path.cc       25 Oct 2003 16:12:45 -0000      1.277
+++ winsup/cygwin/path.cc       26 Oct 2003 01:35:16 -0000
@@ -1178,6 +1178,11 @@ special_name (const char *s, int inc = 1
   if (strpbrk (s, special_chars))
     return !strncasematch (s, "%2f", 3);

+  if (strcasematch (s, ".") || strcasematch (s, ".."))
+    return false;
+  if (s[strlen (s)-1] == '.')
+    return -1;
+
   const char *p;
   if (strcasematch (s, "conin$") || strcasematch (s, "conout$"))
     return -1;

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

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

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