From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) by sourceware.org (Postfix) with ESMTPS id 27C393858D3C for ; Tue, 7 Dec 2021 14:58:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 27C393858D3C Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=cygwin.com Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MTAJl-1mzBWs44xr-00UYjU for ; Tue, 07 Dec 2021 15:57:58 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id F25DBA80A6B; Tue, 7 Dec 2021 15:57:56 +0100 (CET) Date: Tue, 7 Dec 2021 15:57:56 +0100 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: vboxsharedfs - Too many levels of symbolic links Message-ID: Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20211205115411.1619911cb3e2d23f671912ce@nifty.ne.jp> <20211206195527.9b9c09b549fa8fcc2512949e@nifty.ne.jp> <20211207094612.313345b38eac94bae85448b4@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211207094612.313345b38eac94bae85448b4@nifty.ne.jp> X-Provags-ID: V03:K1:/TGdKJmiOCHeaAG0ZGig9+9TTVdYj/eArGRYtlaLT/RieA/1YQX lFvb93aikKJmT2P/0kNMC/z/SUmi96VAgxvF+2wjz8FTMfgxn++tDusRudpT6MZ7AwUCIWm QqDSLdpwIE+q8MkeTNZ7qk1XrnToqCJCu4Ij6ep7Fhsi+ZWUcEDV/uBluAsyPX4gYLTVXP+ N+TB/LjPAmfHQp6WRqcOg== X-UI-Out-Filterresults: notjunk:1;V03:K0:WB94ZJEdGUI=:2yDBe2iT0XtkrFcP5IUabC l3zH9dZkApINDgMy39YQMnVAXH18zjq35KqhPsbSPIo0cweIcAeECyR/x7FoEuty2vnPLF6en bUSmtenQGfADL2riXZUSYWIOKogJXZ5zzuROn4fQcwh7sj+lqvLMJQu3TEI8MZPvQNWPOuivp e8t7s4cHwTF73aReU0mcetEjDJdAH8t2828yJfuShhKA/wg87gr4zLvrWUZTZa1aPmYzTjaG5 HAYE2nK7eE/CXa8kEYPG79SxTct3lXQMzyg3QhpL4UXAM3Hu7OAcNMQ452oOoiOHvabnjxKL5 JaJ/yIv/PfchWEbkNTJa06FTdx+QqkWibEJcyQnCzbxz2nvfx7AU2nIClhswWjESljxTT7w/S 2Y4wNvoHR3b/MZqiAnSN0Nf5925gA+92n0jjSPv7sYRzmOBWNu1f1h8v/Ps1LtRjtk4Bz8gcT mlyGJvDeBjWn2AbJrMnbvaM5gauBdOabL5i6G3X8Zscn6tM2FIPJz0cSm3XSLaQlHf4Tubr2a Iq8sth3hj+BlmqZw0goOTyzvfmWKnXkjQemkPo5liRt0zuwKI1DGL9oifwW9cPZeeFXll+SDF jW9fHXGXZmx1LaYYP2CrP4yleaQM0ChuBve1Dxbj+e27rVPGXvlXOr7aLVdQGnXL1DHMzrhZK IDKbW5nMsaB/KIOXk115TORmvnACY4vpKSpbLg31yw35VruG/eweDFNz/UVrlIPpcNnWsLzlI sDEQUXQfjI2oIkzH X-Spam-Status: No, score=-99.4 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Tue, 07 Dec 2021 14:58:01 -0000 On Dec 7 09:46, Takashi Yano wrote: > On Mon, 6 Dec 2021 19:55:27 +0900 > Takashi Yano wrote: > > First, I think the same. However, with this patch, it sometimes causes > > hang for a few seconds around the code: > [...] > > with path_copy of "//VBoxSrv". I am not sure why. That's expected and nothing really to worry about. It's the network environment access in fhandler_netdrive. I have this on the radar already, because the WNet stuff in there has been broken by Microsoft with certain updates to Windows 10. A SMB security fix has deliberately left behind the WNet calls to enumerate the network environment, because they rely on functionality of older SMB versions. > > > > In addition, > > https://cygwin.com/pipermail/cygwin/2021-December/250103.html > > still needs fix. > > Moreover, this has a problem with "ls -al /cygdrive/z". > The information for ".." is not retrieved correctly. > > drwxr-xr-x 1 yano None 0 Dec 6 13:54 . > d????????? ? ? ? ? ? .. > -rw-r--r-- 1 yano None 29 Dec 4 07:45 Makefile > -rw-r--r-- 1 yano None 17 Dec 6 13:18 a > drwxr-xr-x 1 yano None 0 Dec 6 08:59 aaa > lrwxrwxrwx 1 yano None 1 Dec 6 13:54 b -> a > -rwxr-xr-x 1 yano None 3278626 Dec 7 09:07 cygwin0.dll > -rwxr-xr-x 1 yano None 3549860 Dec 6 08:51 cygwin0.dll.64 > -rw-r--r-- 1 yano None 0 Dec 3 22:16 testfile.txt > > I think '/cygdrive/z/..' should be '/cygdrive', however, > in current cygwin, it is interpreted into '//VBoxSrv'. > > Is this as you intended? > > With my patch which stops to treat UNC path as symlink, > '/cygdrive/z/..' returns '/cygdrive'. Yeah, but... ...what bugs me is that *every* UNC path is treated this way with that patch. If you have a path like /cygdrive/x/a/b/c, with x: being a virtual drive pointing to //server/share, and with "b" being a symlink to "syml", what you get back is either //server/share/a/syml/c without, or /cygdrive/x/a/b/c with your patch. What we would like to get back is /cygdrive/x/a/syml/c So the real problem is not that we have an UNC path, but the fact that the drive letter expression is (correctly, but unwanted) converted to the matching UNC path by GetFinalPathNameByHandle. Bottom line is, your patch is ok, please apply. It would be nice, though, if we could just avoid the drive: -> UNC path conversion and keep the rest. Thanks, Corinna