X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 65ECF3858430
Authentication-Results: sourceware.org; dmarc=none (p=none dis=none)
 header.from=dronecode.org.uk
Authentication-Results: sourceware.org; spf=none smtp.mailfrom=dronecode.org.uk
Authentication-Results: btinternet.com;
 auth=pass (PLAIN) smtp.auth=jonturney@btinternet.com;
 bimi=skipped
X-SNCR-Rigid: 613A8CC30FB71881
X-Originating-IP: [81.129.146.209]
X-OWM-Source-IP: 81.129.146.209 (GB)
X-OWM-Env-Sender: jonturney@btinternet.com
X-VadeSecure-score: verdict=clean score=0/300, class=clean
X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvuddrudegvddgheehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeflohhnucfvuhhrnhgvhicuoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqeenucggtffrrghtthgvrhhnpeehudeuveeujeeujeegueefhedttdekvedtudeileefteetfeefjeejudekfefggfenucffohhmrghinheptgihghifihhnrdgtohhmnecukfhppeekuddruddvledrudegiedrvddtleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopegludelvddrudeikedruddruddtfegnpdhinhgvthepkedurdduvdelrddugeeirddvtdelpdhmrghilhhfrhhomhepjhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukhdprhgtphhtthhopeffrghvihgurdetlhhlshhophhpsegtlhdrtggrmhdrrggtrdhukhdprhgtphhtthhopegthihgfihinhestgihghifihhnrdgtohhm
X-RazorGate-Vade-Verdict: clean 0
X-RazorGate-Vade-Classification: clean
Message-ID: <1afc3b10-e19d-5b97-4ca7-b143f3262e67@dronecode.org.uk>
Date: Fri, 7 Jan 2022 15:44:20 +0000
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
 Thunderbird/91.4.1
Subject: Re: Cygwin setup writing incorrect symlinks for native
Content-Language: en-GB
To: David Allsopp <David.Allsopp@cl.cam.ac.uk>,
        The Cygwin Mailing List <cygwin@cygwin.com>
References: <000201d802ea$e13fd790$a3bf86b0$@cl.cam.ac.uk>
 <e445bd39-b4cb-5d12-1182-b142ff4efe3e@dronecode.org.uk>
 <53ca12d5a17d43089bc38ef67e4cc858@metastack.com>
From: Jon Turney <jon.turney@dronecode.org.uk>
In-Reply-To: <53ca12d5a17d43089bc38ef67e4cc858@metastack.com>
X-Spam-Status: No, score=-1193.2 required=5.0 tests=BAYES_00, FORGED_SPF_HELO,
 KAM_DMARC_STATUS, KAM_EXEURI, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A,
 RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,
 SPF_NONE, 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 <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>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: cygwin-bounces+archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>

On 06/01/2022 16:45, David Allsopp wrote:
> Jon Turney wrote:
>> On 06/01/2022 10:46, David Allsopp wrote:
>>> Running Cygwin setup 2.912 with --symlink-type native (or
>>> CYGWIN=winsymlinks:native) is not correctly translating all symlinks.
>>> A default install has these faulty ones:
>>>
>>> /etc/pki/tls/cert.pem ->
>>> \??\/etc\pki\ca-trust\extracted\pem\tls-ca-bundle.pem
>>> /etc/pki/tls/certs/ca-bundle.crt ->
>>> \??\/etc\pki\ca-trust\extracted\pem\tls-ca-bundle.pem
>>> /etc/pki/tls/certs/ca-bundle.trust.crt ->
>>> \??\/etc\pki\ca-trust\extracted\openssl\ca-bundle.trust.crt
>>> /etc/ssl/certs -> \??\/etc\pki\tls\certs /lib/security/cacerts ->
>>> \??\/etc\pki\ca-trust\extracted\java\cacerts
>>> /usr/share/doc/groff-1.22.4/pdf/mom-pdf.pdf ->
>>> \??\/usr\share\doc\groff-1.22.4\examples\mom\mom-pdf.pdf
>>
>>
>> Thanks for reporting this.
>>
>> Yes, it seems this is messed up where the target of the symlink is an
>> absolute path.
>>
>> I've uploaded setup 2.913 with an attempted fix.
>>
>>     https://cygwin.com/setup/setup-2.913.x86_64.exe
>>     https://cygwin.com/setup/setup-2.913.x86.exe
>>
>> Please try that (you'll have to reinstall the effected packages), and see
>> if it improves things for you?
> 
> Thank you! This fixes it for the Cygwin side, although the symlinks are still technically not right from the Windows side. They're still showing up prefixed \??\.
> 
> It's an age since I mucked around with those functions - IIRC the API function for writing them adds the \??\ itself and doesn't expect it to have been supplied? However, when you read the reparse point you have to remember to remove it yourself because who needs consistency :o)

Thanks for testing.  It seems I still didn't have this quite right and 
these symlinks just happened to work for cygwin, but not native tools.

Please try

   https://cygwin.com/setup/setup-2.914.x86_64.exe
   https://cygwin.com/setup/setup-2.914.x86.exe

> C:\cygwin64>dir /s | findstr ??
> 01/06/2022  04:30 PM    <SYMLINK>      cert.pem [\??\C:\cygwin64\etc\pki\ca-trust\extracted\pem\tls-ca-bundle.pem]
> 01/06/2022  04:30 PM    <SYMLINK>      ca-bundle.crt [\??\C:\cygwin64\etc\pki\ca-trust\extracted\pem\tls-ca-bundle.pem]
> 01/06/2022  04:30 PM    <SYMLINK>      ca-bundle.trust.crt [\??\C:\cygwin64\etc\pki\ca-trust\extracted\openssl\ca-bundle.trust.crt]
> 01/06/2022  04:30 PM    <SYMLINKD>     certs [\??\C:\cygwin64\etc\pki\tls\certs]
> 01/06/2022  04:30 PM    <SYMLINK>      cacerts [\??\C:\cygwin64\etc\pki\ca-trust\extracted\java\cacerts]
> 01/06/2022  04:30 PM    <SYMLINK>      mom-pdf.pdf [\??\C:\cygwin64\usr\share\doc\groff-1.22.4\examples\mom\mom-pdf.pdf]

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