From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32174 invoked by alias); 3 Mar 2020 13:39:31 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 32166 invoked by uid 89); 3 Mar 2020 13:39:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-108.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GOOD_FROM_CORINNA_CYGWIN,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=dear, Dear X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.17.13) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Mar 2020 13:39:28 +0000 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MEVqu-1jAmTH3yYc-00G1z7 for ; Tue, 03 Mar 2020 14:39:25 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id 1CCD4A82778; Tue, 3 Mar 2020 14:39:25 +0100 (CET) Date: Tue, 03 Mar 2020 14:19:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Change in logical link behaviour Message-ID: <20200303133925.GA4045@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <30792264-c452-7ea2-c83f-f368322387ea@emrich-ebersheim.de> <20200302164851.GS4045@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1IYcr18XUmgwOrO2" Content-Disposition: inline In-Reply-To: X-SW-Source: 2020-03/txt/msg00044.txt --1IYcr18XUmgwOrO2 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 4956 On Mar 3 14:17, Rainer Emrich wrote: > Dear Corinna, >=20 > Am 02.03.2020 um 17:48 schrieb Corinna Vinschen: > > On Feb 29 14:10, Rainer Emrich wrote: > >> I try to reliably determine if native Windows symlink are working for a > >> current cygwin environment in a shell script. > >> [...] > >> On cygwin 3.1.4 I get: > >> > >> > >> Directory: D:\cygwin\home\rainer\temp > >> > >> > >> Mode LastWriteTime Length Name > >> ---- ------------- ------ ---- > >> d---- 29.02.2020 13:58 asdfgh-1 > >> > >> So now there is no indication that this is a link. Is this new behavio= ur > >> intended or a bug? > >> > >> I did not try on Windows 10, I'm still on windows 7. > >=20 > > I can't reproduce this behaviour. Keep in mind that, [bla] > I know all the implications. I have to test in an unknown cygwin > environment if it is possible to set native symlinks. > >=20 > > So, on Windows 7 in an elevated shell: > >=20 > > # id -G | grep -Eq '\<544\>' && echo elevated || echo non-elevated > > elevated > > # uname -a > > CYGWIN_NT-6.1 vmbert764 3.1.4(0.340/5/3) 2020-02-19 08:49 x86_64 Cygw= in > > # mkdir qwe > > # cd qwe > > # export CYGWIN=3D"winsymlinks:nativestrict" > > # touch foo > > # ln -s foo bar > > # cmd /c dir /a > > Volume in drive C has no label. > > Volume Serial Number is A8E0-A24E > >=20 > > Directory of C:\cygwin64\home\corinna\qwe > >=20 > > 2020-03-02 17:31 . > > 2020-03-02 17:31 .. > > 2020-03-02 17:31 bar [foo] > > 2020-03-02 17:31 0 foo > > 2 File(s) 0 bytes > > 2 Dir(s) 7.907.352.576 bytes free > >=20 > Yes, this is the same for me, but if you use the powershell >=20 > # powershell "& {Get-Item -Path bar | Select-Object}" >=20 > on cygwin 3.0.7 you get >=20 > Directory: D:\cygwin\home\rainer\temp >=20 > Mode LastWriteTime Length Name > ---- ------------- ------ ---- > -a---l 03.03.2020 14:09 0 bar >=20 > and on cygwin 3.1.4 you get >=20 > Directory: D:\cygwin\home\rainer\temp >=20 > Mode LastWriteTime Length Name > ---- ------------- ------ ---- > -a--- 03.03.2020 14:09 0 bar >=20 >=20 > The only difference is the used cygwin version. So, I don't understand > what has changed. Nothing has changed in terms of symlink handling. Are you saying that `cmd /c dir /a' shows 2020-03-03 14:21 bar [foo] but powershell shows -a--- 03.03.2020 14:21 0 bar for the same file? That would be most puzzeling but certainly outside of Cygwin's control. So I created a symlink again on W7 with Cygwin 3.1.4 and `export CYGWIN=3Dwinsymlinks:nativestrict', and tried with cmd *and* powershell (which I usually don't touch) and I see # uname -a CYGWIN_NT-6.1 vmbert764 3.1.4(0.340/5/3) 2020-02-19 08:49 x86_64 Cygwin # setenv CYGWIN winsymlinks:nativestrict # ln -s foo bar # cmd /c dir /a bar Volume in drive C has no label. Volume Serial Number is A8E0-A24E Directory of C:\cygwin64\home\corinna\qwe 03.03.2020 14:30 bar [foo] 1 File(s) 0 bytes 0 Dir(s) 7.929.241.600 bytes free # powershell "& {Get-Item -Path bar | Select-Object}" Directory: C:\cygwin64\home\corinna\qwe Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 03.03.2020 14:30 0 bar Aha! So powershell does not show the 'l'. Let's try the same on Windows 10: # uname.ORIG -a CYGWIN_NT-10.0 vmbert10 3.1.5(0.340/5/3) 2020-03-02 18:46 x86_64 Cygwin # setenv CYGWIN winsymlinks:nativestrict # ln -s foo bar # cmd /c dir /a bar Volume in drive C has no label. Volume Serial Number is C65C-2A36 Directory of C:\cygwin64\home\corinna\tmp 2020-03-03 14:33 bar [foo] 1 File(s) 0 bytes 0 Dir(s) 23,112,925,184 bytes free # powershell "& {Get-Item -Path bar | Select-Object}" Directory: C:\cygwin64\home\corinna\tmp Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---l 2020-03-03 14:33 0 bar Aha! powershell shows the 'l'. Also, notice how the number of mode bits seem to be only 5 on Windows 7: -a--- ^^^^^ 12345 but *6* on Windows 10: -a---l ^^^^^^ 123456 On Windows 10 it shows 6 mode bits for non-symlinks as well, so the 'l' mode is not just missing on Windows 7 in this specific case, but a generic difference. From my POV, this is just a shortcoming of W7 powershell. Keep in mind that the output of powershell has nothing to do with Cygwin itself. Corinna --=20 Corinna Vinschen Cygwin Maintainer --1IYcr18XUmgwOrO2 Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl5eXgwACgkQ9TYGna5E T6BDyw/+OFNhi2ee5yEMS9xSoT4luy9LrVECpuEtqLzI2BQYC2jamQINqmwZ3b5B ZqqUBssj3CdbgZPi7jJH/5GiT3rMv6oZZDlxG6Aj0pw+nxL2+78dIbGHBUcdpCoO FyDJvmvgoxOmVgil/+domVUWgiik0xoReW7S17EGBhbNgIWxygNI9z1h2sfsdGmA ftwv1JqeThIEakQ8SmqfOX+LPSSthtB8gKr98ULs4pOgNMDOQ+GZCuT/FxjIpEE4 wgN0exUwykKICMKq/ddNF+yBf3n6uYhhhkJUbyLiUCk0G60EYFsfdMzeOrqnMiwy D1K/JW1rzEuaFOIlmAghpjL3k+u7+CR+48c5GrgfKEaDgecSy0tP2sxd13qzG5HO erLwuXBZPaGzFm1r3LbkZJjZMZ66WS4OU9O9EJIMg+Ra5QcWtdC5wsIbnFoN6VkS MbGIyIH9f3hLf2NeZUt8Z55sN4Wc8daiEKo2SCrOpydAm4/5wYM6xiUhANP6gkhH 1OOL/MC/OmkrRqjwE9giskTd69VcU2qBOoEF5OK3hcfe+SKqnSo2YwWC9plxyp5/ W8UbDN+Qkbr8Z7HEEa455WBfy0rI5NxPJP8IaDK/KwNvWFrCTzp63GIZhCBxlxRd rGriy5ar9Z02dM3iuB+dV4ltXjM4JdNE2UyHp/NLKcXLLth6xX0= =ak3d -----END PGP SIGNATURE----- --1IYcr18XUmgwOrO2--