From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by sourceware.org (Postfix) with ESMTPS id 81F363858D28 for ; Sun, 5 Dec 2021 10:36:40 +0000 (GMT) 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 Received: (Authenticated sender: novia@oskog97.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id E3D16240003 for ; Sun, 5 Dec 2021 10:36:38 +0000 (UTC) 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@oskog97.com> To: cygwin@cygwin.com From: Oskar Skog X-Forwarded-Message-Id: <82f94b97-26fe-516a-72c3-3090c6849082@oskog97.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> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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@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: Sun, 05 Dec 2021 10:36:43 -0000 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.