From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66033 invoked by alias); 11 Dec 2017 17:19:18 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 66021 invoked by uid 89); 11 Dec 2017 17:19:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=upwards X-HELO: mail-ot0-f181.google.com Received: from mail-ot0-f181.google.com (HELO mail-ot0-f181.google.com) (74.125.82.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 11 Dec 2017 17:19:13 +0000 Received: by mail-ot0-f181.google.com with SMTP id p3so15368877oti.5 for ; Mon, 11 Dec 2017 09:19:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=BK4mrwqQ5vAxAmbjWeNVun4g+d9WMYgYdONGlbNYRA8=; b=IkWwNxOVSBoGtiYpssEilSTp+IQCH8SV5hE29lBto9epyCrKUxRkzJADkttvN+1S/0 yVJ8Cjcvcnwb6sXreb3xA8WffueEe83xK4JwoA7/7ODRz+CW7OAEULDu8RMVzUOA/xRP lH3PDS8bqaoaJbnbkXUOwfEu+T17dTpfn4wT1CwJooj1WrLCYOLHDD2pmbfd5h9o7xQJ t0CNM4BNIF3iTtwwOuDbJDvD6sPoLclWe3WYyXYCcUbjzAs9JUwxkgTd/2ruhuTm7kgi tn1lbFx1chGehbq67srcZT4aIcEfo6GmrdXFUpO+V9TPrrLqp4AUvZniTWk7vfCkvKrY /TtQ== X-Gm-Message-State: AKGB3mInZdaDDowJs5+X4by6HChu/jkts+inUEMwRc/xM0/Mu+CLTU93 Yht6iumMXQgrcn5A18hJpXhdvOWBzzxuVQw0fl3D X-Google-Smtp-Source: ACJfBoto5a0cBSQT9lmPGopyo0SPSF0eZthy6UBpntDLi/S6CVHt23R9C+HOu74QUsGHTg0WF3oqCAkw9c6axsRyW54= X-Received: by 10.157.65.182 with SMTP id p51mr1116488ote.12.1513012751454; Mon, 11 Dec 2017 09:19:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.74.68 with HTTP; Mon, 11 Dec 2017 09:18:30 -0800 (PST) From: =?UTF-8?Q?Jo=C3=A3o_Eiras?= Date: Mon, 11 Dec 2017 19:58:00 -0000 Message-ID: Subject: Issue with resolving symlinks (realpath, readlink, etc) To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2017-12/txt/msg00081.txt.bz2 Hi. Programs and functions that rely in realpath() are broken. Example: $ cd $ ln -s /var symlink $ cd symlink $ readlink -m . /var $ mkdir subfolder $ cd subfolder $ readlink -m . /home/user/symlink/subfolder # should be /var/subfolder This is the block I think is causing problems, as it breaks the loop as soon as a real file is found, instead of iterating further upwards resolving ancestors. https://cygwin.com/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/path.cc#l994 There also a comment at line 736 that says: "Scan path_copy from right to left looking either for a symlink or an actual existing file. If an existing file is found, just return. If a symlink is found, exit the for loop." Thank you. -- 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