From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) by sourceware.org (Postfix) with ESMTPS id E3D613969007 for ; Mon, 19 Apr 2021 12:58:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E3D613969007 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MmyzH-1ly9702DZ9-00k5rI for ; Mon, 19 Apr 2021 14:58:09 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id B81FBA80E8B; Mon, 19 Apr 2021 14:58:08 +0200 (CEST) Date: Mon, 19 Apr 2021 14:58:08 +0200 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: realpath issue with native[strict] symlinks Message-ID: Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:JBhj0fuoi1BF5jE2oB5eXzXhn3Z3iicywrhrZEQ1wXeQU4ykTJx 5G6/uKcCIwrRiYA9PcMUXwYqAf4Sw2GnqdPGlGdTgewqdDn03gS3tb3aPTP/oQBI19kyTF0 PtkQ2WUFzFYP5cpezEw4dIsv5QPoXxgJFxTldwUKjdn3Os7W8EHVYzPDeXsjG7sm6Ont2ks OyWRcI5a57hAmWFd7SLLA== X-UI-Out-Filterresults: notjunk:1;V03:K0:We7qmnj5s+8=:5rZpwoFlsjFXA9jrnr/Ce2 HXjdLTIU0RV0Z5vI00SC1se5EtZL/1MuXdhh4N+hu9aUXzZ0IK9BHJcCSKs/FeUPPaRO+p1ql wuv5RrCicrt25tsktKwFaKvVL9MAt46bKqFfbBJv3fRbcxV9/TG2mJ2PcTa9wnYPYWb+kRDT5 ZgWopq1dLZ6cHWedI51qt8rUg5Cz9QzAwqIJU4F21wyIs65jHJdFMuu3RcmT2Bl155TjEYIBu VMd5G3qLMcFeJ3rAl4d+mz55n+gnbuZinLIp98YkCwYrxpSMG+Hm8VUCtT8wa9dmnR0rmGf3b iJ8yYbqdpVwbWSz3gtsqdo26480+XlHD30Jc2UqgmNVXJLmJoqcaX1JTW7c0qby1MQ0qGQUHy 8kgT2y0oPJ9fHeljKZnlIMRG1Uc9KxVQ4H5Hq44EupOcOgRKHHKGJzwL2K10ZgPJdUEGolMMb i4MO+0cyFtgyUSr7E56LCSYwaAjP0PV4qKlvoLEP12qxygBT1gJv+Agkm3NOtJkMxWP6J9ckK FOUp80fqtT3i8BmFDdJXdg= X-Spam-Status: No, score=-100.5 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 12:58:15 -0000 On Apr 18 10:59, Orgad Shaneh via Cygwin wrote: > Hi, > > When winsymlinks:native/nativestrict is used, realpath doesn't resolve > the full path correctly, when a symlink to the same directory is used. > > Example follows. The output is: > /home/user/recurse/test/d1 > /home/user/recurse/test2/d1 > > While it should be /home/user/recurse/d1 for both. I was going to write: Nothing we can do about without re-implementing Cygwin's path handling from scratch. For historical reasons, POSIX paths are evaluated in a non-POSIXy manner from right to left. If the resulting path is an existing path, the assumption is that no inner path component is a symlink. That's true as long as Windows didn't support symlinks/junctions and Cygwin didn't support them. But now I'm writing this: Probably I have a workaround for this problem. I added a certain test to the function checking the outer path component, so the checks for path validity don't stop at the outer path component, just because it's a valid Windows path. I pushed the patch and uploaded new developer snapshots to https://cygwin.com/snapshots/ Please give them a try. Thanks, Corinna