delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/12/05/05:37:00

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 81F363858D28
Authentication-Results: sourceware.org;
dmarc=none (p=none dis=none) header.from=oskog97.com
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oskog97.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oskog97.com; s=gm1;
t=1638700599;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:mime-version:mime-version:content-type:content-type:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references;
bh=1XWoWz7JbTm44dumzMmVAK89EUKB6v1U3jGLzpgLtbk=;
b=bclewTinU8IBfFv32yyYjOCrDhwVNHe6Edp/fzhKx8vgivvtBuXPcqU3/g4ZJx/vhlcpop
IwByjANddOrD7E/VogINH1p4bJ2erhv1mb5exJirOaEiwe+vM5sSK68h1NZ0EMNO7uzo4l
j11UVPCsb5MVLGovF6DO3zFq49usxzbaXowS80WpckI5+Nk6hYqg44ZuYK7YdOIashD9LD
SsW6rqsM4bOW0QCCbGn+0HTbpUEtf6V3GraOWi6aNNDn5fwyWeT5sqc8DYV8iRxxlzh59i
huQ+aOuQiwIys8n3CE+Hd4Dqb6oi9pC3nI0++ci6RSn8GgLx1saK0H8DnQcIbQ==
Subject: Fwd: vboxsharedfs - Too many levels of symbolic links
References: <82f94b97-26fe-516a-72c3-3090c6849082 AT oskog97 DOT com>
To: cygwin AT cygwin DOT com
From: Oskar Skog <novia AT oskog97 DOT com>
X-Forwarded-Message-Id: <82f94b97-26fe-516a-72c3-3090c6849082 AT oskog97 DOT com>
Message-ID: <5720e45f-02c0-64b1-91e1-e3e754b3a921@oskog97.com>
Date: Sun, 5 Dec 2021 12:36:37 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
MIME-Version: 1.0
In-Reply-To: <82f94b97-26fe-516a-72c3-3090c6849082@oskog97.com>
X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW,
RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS,
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>
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 2021-12-05 04:54, Takashi Yano wrote:
> In 64bit Windows10, for vbox shared path, GetFinalPathNameByHandleW()
> returns path with trailing '\'. As a result, RtlEqualUnicodeString()
> fails and tries to resolve symlink repeatedly.
> 
> For example, RtlEqualUnicodeString() compares \??\UNC\VBoxSrv\tmp and
> \??\UNC\VBoxSrv\tmp\, then it fails.
> 
> This does not happen in 32bit Windows10. It seems that UNC path is not
> treated as a symlink in 32bit Windows10. I am not sure why.
> 
> Therefore, I have applied a patch which stops to treat UNC path as a
> symlink for testing as follows.
> 
> diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
> index baf04ce89..31a96ca58 100644
> --- a/winsup/cygwin/path.cc
> +++ b/winsup/cygwin/path.cc
> @@ -3490,6 +3490,9 @@ restart:
>   	  ret = GetFinalPathNameByHandleW (h, fpbuf, NT_MAX_PATH, 0);
>   	  if (ret)
>   	    {
> +	      if (wcsstr (fpbuf, L"\\\\?\\UNC\\") == fpbuf)
> +		goto file_not_symlink;
> +
>   	      UNICODE_STRING fpath;
>   
>   	      RtlInitCountedUnicodeString (&fpath, fpbuf, ret * sizeof (WCHAR));
> 
> I have confirmed this patch fixes the issue. In addition, this patch
> also resolves the issue:
> https://cygwin.com/pipermail/cygwin/2021-December/250103.html
> 
> Is this the right thing?
> 
> -- Takashi Yano


I can confirm that the patch fixes the issue with VirtualBox shared
folders.

-- 
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