From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by sourceware.org (Postfix) with ESMTPS id E99C93896C2F for ; Fri, 7 May 2021 21:20:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E99C93896C2F Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mkpj7-1lFupC46JT-00mJwa; Fri, 07 May 2021 23:20:50 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 60278A8075A; Fri, 7 May 2021 23:20:49 +0200 (CEST) Date: Fri, 7 May 2021 23:20:49 +0200 From: Corinna Vinschen To: cygwin@cygwin.com Cc: Orgad Shaneh Subject: Re: realpath issue with native[strict] symlinks Message-ID: Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com, Orgad Shaneh References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:KfG1wUwYXs1YvPzJMqmOsjnQHPbacXk7az4EoCIewEdb75tYoLO eNp4MdhvT8CIwZ8EqJ2eXoMoiZJISVG/foSRIc0ppzT+ZEXiILorzbHQjknOsrKdHJ6LTHH /gnYFa3amVfEXJgE9KyD0NMXxRpVyVuZvGJUKxUnhtdddm0C6NrYR2opNq0NQQWpi1eTx6h a1QNX/7ZQVYTWac68lovQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:/izWkFX24EQ=:7OTD6sTpHardkE4HznEVz4 l8BcxUDhOqdkM6Ud9734MzwSNy5OCz7Va7KAH4sAzHqcBoM46RxXNRc/IwCYz75GRsANFzKDE +ejOgP6JctWkrvBuh2wgiwoXPO52zKork/aM3MkIbc0Y3/6TzcR01KeLLYwaKv84wpYSTd/RJ Ku8BSnOydv3lAb4SYq52yOclUmsomVlDnz0d3jaS47G6QpR9hbFQQV46oZZEf36+99EpN+ifG JXck6nz7x8G/wd+psiaDO0oDkHhdegE/OwTE7KXO9xHcB3ujfsYt7uvv+48H92NgNAgWwHPOv YPRPha+VYuFNd59qxDCJXI0xz0z/hzPT2NVf9oPRiTwJQ+zLVMWSW2HolYzfx8QqJ2Ena30RR cnMXMC7jPBZW4TaVdXFkg1LJ3eUfFKL08+I9wDdRIHTFiXVbldmYUPbBG0SRqoMFGH38UxsW2 MsgiruxGmQqdKh4vyB3zokDdgthJrNyKG0wsjsg34fq4OBonuZ1vuS/+EQYeKvPz440pa3nsx Hh9jJFGa/f2daFsRrvbX6o= X-Spam-Status: No, score=-100.3 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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: Fri, 07 May 2021 21:20:55 -0000 On May 6 21:36, Orgad Shaneh via Cygwin wrote: > On Thu, May 6, 2021 at 8:44 PM Corinna Vinschen > wrote: > > > > On May 4 22:52, Orgad Shaneh via Cygwin wrote: > > > On Tue, Apr 27, 2021 at 8:44 AM Orgad Shaneh wrote: > > > > > > > > On Apr 19 12:58, Corinna Vinschen via Cygwin wrote: > > > > > On Apr 18 10:59, Orgad Shaneh via Cygwin wrote: > > > > > > > > > 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. > > > > > > > > Tried now, and it works for me. Thanks a lot! > > > > > > > > - Orgad > > > > > > > > > Hi Corinna, > > > > > > This change breaks access to subst drives. Reported on MSYS2: > > > https://github.com/msys2/msys2-runtime/pull/38#issuecomment-832160980 > > > > > > Can you please have a look? > > > > Works fine for me: > > > > $ subst T: C:\\cygwin64\\home\\corinna\\tmp > > $ subst > > T:\: => C:\cygwin64\home\corinna\tmp > > $ ls /cygdrive/t > > bar cygwin foo gawk-5.1.0 ocaml openssh-8.5p1 recurse tst > > > > TAB completion works, too. > > Right. But if you set / for cygdrive in /etc/fstab it fails: > none / cygdrive binary,posix=0,user 0 0 I reworked the code handling native symlinks to handle virtual drives as well. It might even be a tiny bit quicker now. The changes have a behavioral change, but I think this is for the better: Virtual drives are not treated as drives anymore, but as symlinks. Given they are just pointers to other drives or directories, tha't much closer to reality. I. e., in case of my above virtual drive T:, what you'll see in the /cygdrive dir (unless your cygdrive prefix is / only) is this: $ ls /cygdrive $ ls -lG /mnt total 16 d---r-x---+ 1 TrustedInstaller 0 Apr 29 21:07 c drwxr-xr-x 1 corinna 0 Dec 31 1979 e lrwxrwxrwx 1 corinna 32 May 6 20:43 t -> /cygdrive/c/cygwin64/home/corinna/tmp I uploaded new developer snapshots to https://cygwin.com/snapshots/ for testing. Thanks, Corinna