delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/06/12/15:44:52

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=BPBGSbyryZJgNr4+tl1GNBqOQEp/UgaemD+AzCXTKDq/dK7ePIGuW
3dLAUyNBXsJAZQjoyO+A3IfQl8iqfGrIgTw2g5AzvAt5Q1OM6e05SNsLFYHRWerd
t1Em6xQdSuP+cvB+7/k+4FlJVxKm35s78LpPWKbFG7iucIwORBUl9E=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=um/YuDlnC3P9LvQVlcjeVHWJ5Rc=; b=ZYspGY1MYiqZVJo0W2ZvRD+/afS8
hbAo9iCq4Wr+szCpH0LNHabdTzylAZ5gBUn4DU5fthZcZkbpMpPe5x+DMQAH3lJp
GAZuFInirelbhI3EkfUdUZw8/gWxM37plHAXGfsLWqohUaSb3lFm8hh2t6kxtv5j
2GKMq5P/tkXhRJs=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1
Date: Wed, 12 Jun 2013 21:44:36 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: [GOLDSTAR] Re: [PATCH] Check for existence of the path before processing '..'
Message-ID: <20130612194436.GD1736@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <001401ce66a4$bb9029a0$32b07ce0$%fedin AT samsung DOT com> <20130612174600 DOT GA1736 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20130612174600.GA1736@calimero.vinschen.de>
User-Agent: Mutt/1.5.21 (2010-09-15)

On Jun 12 19:46, Corinna Vinschen wrote:
> Hi Fedin,
> 
> On Jun 11 17:08, Fedin Pavel wrote:
> >  Hello!
> > 
> >  Some time ago i reported ability to access things like
> > "/usr/nonexistent/..bin". I still had this problem and i tried my hands on
> > fixing it.
> >  The patch works by checking the actual existence of the path before
> > removing the last component from it. For performance reasons, only one check
> > is done for things like "../..". Because, obviously, if "/foo/bar/baz"
> > exists, then "/foo/bar" exists too. Also, the check is done only after some
> > components have been added to the path. So, for example, current directory
> > (obtained when processing relative paths), will not be checked.
> >  I tried to add a similar test also to normalize_win32_path() function,
> > however this broke things like "cd /usr/src/..". For some reason, a POSIX
> > version of the path (but with reversed slashes) is passed to this routine
> > when expanding mount points, so, consequently, test for "\usr\src" using
> > GetFileType() fails.
> >  I think it's ok, at least POSIX paths now behave in POSIX way. I have
> > tested against performance, there is some loss (~0.2 seconds), but only for
> > referencing '..'.
> >  With this patch i am able to compile the latest version of glibc with no
> > problems.
> 
> I applied your patch with a little stretch of imagination as falling
> under the trivial patch rule, which doesn't require a copyright
> assignment.  I only tweaked it slightly since I found that moving the
> setting of check_parent has a tiny performance advantage.

FYI, I just uploaded a new 32 bit snapshot, as well as the 64 bit
test package 1.7.21-2 containing this patch.

Please give it a try.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 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