From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69590 invoked by alias); 2 Mar 2020 16:49:06 -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 69481 invoked by uid 89); 2 Mar 2020 16:49:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-108.8 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=volume, SYSTEM X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.126.130) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Mar 2020 16:49:03 +0000 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mc02Z-1jf7Oc0XT5-00dYcf for ; Mon, 02 Mar 2020 17:48:53 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id 72AEFA82778; Mon, 2 Mar 2020 17:48:51 +0100 (CET) Date: Mon, 02 Mar 2020 16:49:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Change in logical link behaviour Message-ID: <20200302164851.GS4045@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <30792264-c452-7ea2-c83f-f368322387ea@emrich-ebersheim.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="avNtfD0ffNO6L/9g" Content-Disposition: inline In-Reply-To: <30792264-c452-7ea2-c83f-f368322387ea@emrich-ebersheim.de> X-SW-Source: 2020-03/txt/msg00016.txt --avNtfD0ffNO6L/9g Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 3278 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. >=20 > Therefor I used a powershell snipped: >=20 > mkdir asdfgh > ln -s asdfgh/ asdfgh-1 > powershell "& {Get-Item -Path asdfgh-1 | Select-Object}" >=20 > On cygwin 3.0.7 the output is as follows: >=20 >=20 > Directory: D:\cygwin\home\rainer\temp >=20 >=20 > Mode LastWriteTime Length Name > ---- ------------- ------ ---- > d----l 29.02.2020 13:58 asdfgh-1 >=20 > On cygwin 3.1.4 I get: >=20 >=20 > Directory: D:\cygwin\home\rainer\temp >=20 >=20 > Mode LastWriteTime Length Name > ---- ------------- ------ ---- > d---- 29.02.2020 13:58 asdfgh-1 >=20 > So now there is no indication that this is a link. Is this new behaviour > intended or a bug? >=20 > I did not try on Windows 10, I'm still on windows 7. >=20 > Rainer >=20 I can't reproduce this behaviour. Keep in mind that, by default, you *have to* run in an elevated shell to be able to create native NTFS symlinks, *and* you *have to* set the environment variable CYGWIN(*) to contain "winsymlinks:native" or "winsymlinks:nativestrict". The latter is nice for testing, it refuses to fall back silently to the default Cygwin-only symlinks but fails instead if it can't create a native NTFS symlink. So, on Windows 7 in an elevated shell: # 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 Cygwin # 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 Directory of C:\cygwin64\home\corinna\qwe 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 In a non-elevated shell: $ id -G | grep -Eq '\<544\>' && echo elevated || echo non-elevated non-elevated $ uname -r CYGWIN_NT-6.1 vmbert764 3.1.4(0.340/5/3) 2020-02-19 08:49 x86_64 Cygwin $ cd qwe $ export CYGWIN=3D"winsymlinks:nativestrict" $ rm bar $ ln -s foo bar ln: failed to create symbolic link 'bar': Operation not permitted $ export CYGWIN=3D"winsymlinks:native" # !!! $ ln -s foo bar $ cmd /c dir /a Volume in drive C has no label. Volume Serial Number is A8E0-A24E Directory of C:\cygwin64\home\corinna\qwe 2020-03-02 17:31 . 2020-03-02 17:31 .. 2020-03-02 17:38 20 bar 2020-03-02 17:31 0 foo 2 File(s) 20 bytes 2 Dir(s) 7.907.352.576 bytes free The symlink created last is a Cygwin-only symlink (special file with SYSTEM attribute), not a native symlink. Corinna (*) https://cygwin.com/cygwin-ug-net/using-cygwinenv.html (*) https://cygwin.com/cygwin-ug-net/using.html#pathnames-symlinks --=20 Corinna Vinschen Cygwin Maintainer --avNtfD0ffNO6L/9g Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl5dOPMACgkQ9TYGna5E T6Dbgw//YErLo6rUq3WHI0WfKjlvNmUPRk+xTv2dz+RaK2DKS78E/Zw8ruVNN8u8 LPXZ8WBGETCdp7RPohMbXkS202RbWmhEYaQgr0usk5MybbXIBXSM65Xpzq93xE5f nvmFXhNGNbQlsGztENaFJQak4BT4E+0/sJk591zeh+SPgVHDJEeK7zSb1qbiBLIm jsNQuHcL/LBrfRR2IyemDKJCiNksHJQk5aQeH1GoXLbBYcMoSI35wIRMhMw02/gm MlDapgQWxzqXPo1atf0ivGn6K+Ox3O7SEbrHQD/JaW3e2gikIAKbmsBzvEqcixcX 7ZQEcHqou5uYVmC8ABY7ApJ+WJn8cagG9U5l3C9zW4vSfP0Q1ouYHhnlWJNn0pMC aHkw6Fym0K5Ty2R2VVho7F0J0Bxz7edDLncjxtRxXjoQYRRNKpCTOr+KneTJjZwR Wc00ReD9Z6dP5S+RkbDJpyZUWYLmIxCaVKwOFwIcnWH3sOnLuVYimU6rFAVD40sh hovchxJ2J0wDzrOvElHuXtJzNmM4/eJ1ydOP0VyQ1G9BzJrNeRlqw1lNqHJNPund NJBOpqsGTFE/BMwKPtGvYWOeUJA73+zP9+yR8N1xyC55ma7PFW53c+oDb3znxBx7 MLY3npho78X+atU8NVzNWWKtk7u+F0xtH0ZHspzBRu9F7ynLtDE= =rVGH -----END PGP SIGNATURE----- --avNtfD0ffNO6L/9g--