delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/01/12/11:04:27

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 773D33857C5C
Authentication-Results: sourceware.org;
dmarc=fail (p=none dis=none) header.from=cl.cam.ac.uk
Authentication-Results: sourceware.org;
spf=pass smtp.mailfrom=return.smtpcorp.com
From: David Allsopp <David DOT Allsopp AT cl DOT cam DOT ac DOT uk>
To: The Cygwin Mailing List <cygwin AT cygwin DOT com>
Subject: RE: Cygwin setup writing incorrect symlinks for native
Thread-Topic: Cygwin setup writing incorrect symlinks for native
Thread-Index: AdgC6QhEcjWCNf+4QROdOTByZUljCgALkAMAAAE1U0AAMFR2AABXrioAAD8CtYAAZU84QA==
Date: Wed, 12 Jan 2022 16:03:40 +0000
Message-ID: <5738faa0199943b99d8d6a0d2da71ed5@metastack.com>
References: <000201d802ea$e13fd790$a3bf86b0$@cl.cam.ac.uk>
<e445bd39-b4cb-5d12-1182-b142ff4efe3e AT dronecode DOT org DOT uk>
<53ca12d5a17d43089bc38ef67e4cc858 AT metastack DOT com>
<1afc3b10-e19d-5b97-4ca7-b143f3262e67 AT dronecode DOT org DOT uk>
<1a271142acbc4e2188fc3b6981fa03e0 AT metastack DOT com>
<6d1a8071-76f7-b634-b4ce-07ce6c18a8d9 AT dronecode DOT org DOT uk>
In-Reply-To: <6d1a8071-76f7-b634-b4ce-07ce6c18a8d9@dronecode.org.uk>
Accept-Language: en-GB, en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [172.16.0.127]
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.65 on 62.31.23.242
X-Report-Abuse: Please forward a copy of this message, including all headers,
to <abuse-report AT smtp2go DOT com>
Feedback-ID: 614951m:614951apMmpqs:614951sAnFcgr92W
X-smtpcorp-track: 1n7g619EFuo_95.3kvl15ny4f5a_
X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,
HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_EXEURI, SPF_HELO_PASS,
SPF_PASS, TXREP autolearn=no 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-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>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

Jon Turney wrote:
> On 09/01/2022 09:35, David Allsopp wrote:
> > Jon Turney wrote:
> >> 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 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
> >
> > I'm afraid that's just changed the \??\ to \\?\ on those symlinks.
> 
> Well, that has the advantage of being correct :)
> 
> (since it's the 'Win32 File Namespace' prefix, which
> CreateSymbolicLinkW() is documented to accept for the target filename, and
> is required when that exceeds MAX_PATH (260) characters)
> 
> In my (brief) testing, e.g. the CMD builtin 'type' is able to open
> symlinks of this form.  However, it seems there are some parts of Windows
> (e.g. DIR, File Explorer), which don't handle symlinks like that well.
> 
> So, I've copied the behaviour of the cygwin DLL, which avoids using that
> prefix if the target is less than MAX_PATH characters.  This seem to work
> better in those cases with typical paths (but I'd claim we're just working
> around a bug in Windows here, as things will still be broken if the cygwin
> root is a path long enough that we can't do that).
> 
> Please try:
> 
>    https://cygwin.com/setup/setup-2.915.x86_64.exe
>    https://cygwin.com/setup/setup-2.915.x86.exe

That's working (for cmd as well), thanks!


David

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