X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 33C8A3896C0E
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1621428174;
	bh=s5xDNv1O6SJwRctY3UFcXEK68NWIZeX/eV6S/d9QCH0=;
	h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
	 From;
	b=NzVf27iajdEeHr9F/FPfaiWV4JjQG/zUgu9g4AkVaxFux3rrrCf6zC+wTyapu/O2D
	 WRQGAz5Klih2bXpVZG4GF+qq0qhbdn62b9QEYFl3YEMM+k6v4vPG8w1UAB1e6q2Mdq
	 1gtG2zDoCCEcTYRqROFzyCepai/AdJmQ5RUeuoOA=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3EDA2388C037
Date: Wed, 19 May 2021 14:42:49 +0200
To: cygwin@cygwin.com
Subject: Re: realpath issue with native[strict] symlinks
Message-ID: <YKUHyWcpxMR1s/79@calimero.vinschen.de>
Mail-Followup-To: cygwin@cygwin.com
References: <alpine.BSO.2.21.2105181301130.14962@resin.csoft.net>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.BSO.2.21.2105181301130.14962@resin.csoft.net>
X-Provags-ID: V03:K1:V51tPqbtvGkSzY9N2riiGMgpQa6ZgqpF4dl5oSyVX+Yr9mBAYnr
 D1oIWe7zxWfckKik/thclMvlloSbVcfj7QyYq34gsjq8zxwUEpT0wrf3q0HjFJaHYVmy4gd
 4t0Jqmhzxatdd7eOMvI3qa7jD3TYfmMTJjIK6lukXVKRo+O4ASsJ8kJhjYgxx9vQhXXgFuj
 /KfXgU7+EXPmly6PHNzBQ==
X-UI-Out-Filterresults: notjunk:1;V03:K0:pdT5A10yDLM=:Umu/MRBlCPVpKJk0Vvgthi
 L85IBXo2K5iSrMA+mcnW+tO0ZSM1qwLq7Ym0PooSJP/Cmm99oL06koOmlSapDhX7PzPqWV4fS
 bhWY62ukMwLtBpknjQHnRjdRVg9EwvgPxCphFYVOa3tGlBIkVUc8ObdpVDfU2TR/2Tpt1V/f5
 VPfzHCoPJP2RTuwmYJSgmSaSEyfjp0ycqQ0GjXoOjc1Rve7MsS4VWr4mvw9mg1jpqiyvdIoK5
 gz5i5ETOQjmjNVLlHJOPEO/gKLiFyNVUqO++N8ZDhULV37GIWsiSY7/zExnRx7kUOvlR/9dx8
 meiDc3Rnx0BwWNOb45KPR390+58RBELym0VkjBebHt2jdKIXYfttYAtlTYqgwAEqX1HgW6in4
 qnnBWXeTHX4RDqe48kV56rjeWUXds8C8cMfXoJVdg8q6+o3Efx6T2qjZjbRR2U2gIAwug8M4H
 2NUVZfzPRpwRHiZl9MKVkJ0By7AZAeEVuL/mvJSJZO+HZonKjZKme47a4VKRzwACmU5QAW0d2
 kxfyAE+jpGilEgl++s4Ktw=
X-Spam-Status: No, score=-106.4 required=5.0 tests=BAYES_00, GIT_PATCH_0,
 GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE,
 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 <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin@cygwin.com>
Reply-To: cygwin@cygwin.com
Cc: Corinna Vinschen <corinna-cygwin@cygwin.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>

On May 18 13:01, Jeremy Drake via Cygwin wrote:
> Sorry ,forgot subject
> 
> On Tue, 18 May 2021, Jeremy Drake wrote:
> 
> > > Sorry, but there's only this or that, not both.  Either we revert the
> > > entire change, including the native shortcut stuff, or we do it
> > > completely and fully, including handling virtual drives as symlinks.
> >
> > I had success with just the following change (of course comments would
> > also need to be updated):
> >
> > diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
> > index 4ebaf4dc6..53534b8b6 100644
> > --- a/winsup/cygwin/path.cc
> > +++ b/winsup/cygwin/path.cc
> > @@ -3670,8 +3670,7 @@ restart:
> >  		   somewhere else, thus, it's a symlink in POSIX speak. */
> >  		if (upath.Length == 14)	/* \??\X:\ */
> >  		  {
> > -		    fileattr &= ~FILE_ATTRIBUTE_DIRECTORY;
> > -		    path_flags |= PATH_SYMLINK;
> > +		    goto file_not_symlink;
> >  		  }
> >  		/* For final paths differing in inner path components return
> >  		   length as negative value.  This informs path_conv::check
> >
> > Treating mapped/subst drives as though they were not symlinks, without
> > messing with intermedate symlinks.

It was that simple, surprise, surprise...

I pushed the change under your name.


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