delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/12/08/05:38:17

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B691B385800B
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1638959896;
bh=99V3CLD0JY8Y6iFzNy2c1Z5dL33wtj8O/f8NA0x13MY=;
h=Date:From:To:Subject:References:In-Reply-To:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
Reply-To:From;
b=tKwbYJrtQ4hlUNi2EpWcqbqf1F6xrF26z1CVpOo2q0eLwLSZS3B2KYUuUnSvwtDwQ
tLig1Ei3wBf+QG1D+GiFj2RbghIO4bT8IehT0o/EBqXZuPv/1DLn6ZOfAye8RN3akJ
kC1k60fvwr1lhiQ8HxH9gDQujmSQdVud7qmwQFXE=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 080273858D28
Authentication-Results: sourceware.org;
dmarc=fail (p=none dis=none) header.from=cygwin.com
Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=cygwin.com
Date: Wed, 8 Dec 2021 11:37:39 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: vboxsharedfs - Too many levels of symbolic links
Message-ID: <YbCK8/w9KfjB+b/N@calimero.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Ya+WvmECA+zAbuV9 AT calimero DOT vinschen DOT de>
<20211208172008 DOT 01b11239c374604abf638a19 AT nifty DOT ne DOT jp>
MIME-Version: 1.0
In-Reply-To: <20211208172008.01b11239c374604abf638a19@nifty.ne.jp>
X-Provags-ID: V03:K1:naXLOUaNLIEvTYkzVBBcwvyy7+BZMTj1X9OC6T7KBsuT0h+/F8T
qnByBctPu5Y7DNPXmYdnIfqRf13VhYdAarNbat8NwV/M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IKE_H4, RCVD_IN_MSPIKE_WL, 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 AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Reply-To: cygwin AT cygwin DOT com
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On Dec  8 17:20, Takashi Yano wrote:
> On Tue, 7 Dec 2021 18:15:42 +0100
> Corinna Vinschen wrote:
> > Hi Takashi,
> > 
> > ----- Forwarded message from Corinna Vinschen <corinna-cygwin AT cygwin DOT com> -----
> > > The idea of the GFPNBH call is to short-circuit the path_conv handling
> > > in case we have native Windows symlinks in the path.  My example above
> > > was only considering what comes out of the `if ((pc_flags & ...) { ... }
> > > ' expression starting in line 3485 (assuming "b" is a native symlink).
> > > 
> > > What I mean is this: Your patch disregards the entire string returned by
> > > GFPNBH, if the returned path is an UNC path, no matter what.
> > > 
> > > But what if the incoming path already *was* an UNC path, and potentially
> > > contains native symlinks?  In that case you have no reason to disregard
> > > the resulting path from GFPNBH.
> > > 
> > > And if it was a drive letter path, wouldn't it be nicer to just convert
> > > the UNC path prefix back to the drive letter and keep the rest of the
> > > final path intact?
> > > 
> > > However, both of these scenarios require extra code, which isn't that
> > > important for now, so, never mind.
> > ----- End forwarded message -----
> > 
> > What I meant is something like the below (entirely untested).  Yeah, I'm
> > not sure myself, if it's worth the effort...
> > [...]
> I confirmed that your patch works nicely.
> 
> ...except when the drive is created by subst using UNC path,
> e.g. subst w: \\server\share.
> 
> In this case, WNetGetConnectionW() fails with ERROR_NO_NET_OR_BAD_PATH.
> 
> So, I modified your patch a bit.
> 
> What about attached patch?

Oh, great!  GetVolumePathNameW is the function I somehow missed when
looking into the Microsoft docs yesterday, so thanks for modifying the
patch this way.

Please push.


Corinna

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019