delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/07/31/04:55:31

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:from:to:subject:date:message-id:mime-version
:content-type:content-transfer-encoding; q=dns; s=default; b=yvx
UAVcNqzCxI95HbnIOtCQnmgap29RGru5qlH1MxELoQ1NbZ13ka546MaJAgk5urny
SEp+jKNP3cVJbRYrJeuRs4UyNL5sQv3Yz3qnejivUKFyVuRJoL328sNFjTq4dHuK
h6vZpyQunhQEb73XW0JiFFVleUFh52F4nKY/kjZU=
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:from:to:subject:date:message-id:mime-version
:content-type:content-transfer-encoding; s=default; bh=cGse+C83R
scJHMTRc7ob32JhP0s=; b=KK5LqpeNdtWMW56NAYb25EiQ52wDnp97oNUimgUT+
EVAaEA5i08QlS5fPed+62Yb/51vjrpNMoNf5R8y+fcGLT25cp6+R3GTuoaDVhG0m
dyDsuiHD/64CFneHUL9ntQhtgbBw/YPvB+1y423TxVAdrt2R/BS223eVcmlHQ4pY
3o=
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=-0.8 required=5.0 tests=AWL,BAYES_50,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE,SPF_HELO_PASS autolearn=no version=3.3.1
From: Pavel Fedin <p DOT fedin AT samsung DOT com>
To: cygwin AT cygwin DOT com
Subject: [BUG ?] Failed to rebuild Cygwin
Date: Wed, 31 Jul 2013 12:55:04 +0400
Message-id: <003401ce8dcb$a630b310$f2921930$%fedin@samsung.com>
MIME-version: 1.0

 Hello!

 I have occasionally found a little problem in path check code. Attempt to
reference thing like '/..' fails, however at least under Linux this resolves
to root, and you can actually attempt to go past-root as many times as you
want, e. g. '/../../../..'. The bug was occasionally revealed by 'make' test
suite.
 I wanted to fix it, but cannot rebuild Cygwin DLL. The build ends up in:
--- cut ---
x86_64-w64-mingw32-g++  -o strace.exe strace.o path.o -L/usr/lib/w32api
-static -lntdll
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/../lib/crt2.o: In function
`__tmainCRTStartup':
/usr/src/debug/mingw64-x86_64-runtime-3.0b_svn5935-1/crt/crtexe.c:285:
undefined reference to `_set_invalid_parameter_handler'
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/../lib/libmingwex.a(lib64_libming
wex_a-mingw_pformat.o): In function `__pformat_exponent_digits':
/usr/src/debug/mingw64-x86_64-runtime-3.0b_svn5935-1/stdio/mingw_pformat.c:1
76: undefined reference to `_get_output_format'
collect2: error: ld returned 1 exit status
Makefile:143: recipe for target `cygwin-console-helper.exe' failed
make[3]: *** [cygwin-console-helper.exe] Error 1
--- cut ---
 Likely some MinGW CRT bug ?

 P.S. I suggest that the way to fix the described path check bug is to undo
your small optimization and move back setting check_parent flag to:
--- cut ---
      /* Strip runs of /'s.  */
      if (!isslash (*src))
        {
	  *tail++ = *src++;
	  check_parent = true;
	}
--- cut ---
 The idea behind this is that the check will take place only if we have
actually got something to check (at least one non-slash character). In case
of '/..' the first 'isslash(*src)' returns TRUE, consequently the loop will
not run at all.
 An alternative is to add a check against 'dst' being empty around the
actual check:
--- cut ---
		      path_conv head (dst);
		      if (!head.isdir())
		        return ENOENT;
--- cut ---

 A test case for this problem is being able to execute 'ls /../../..' and
get listing of '/'.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia




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