X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=CW8DmXtrbjOHVaEWr5wAPEEDyJAsgvkL9xOROyOrcmZhvFSaQ+Biw Fam29WLnv/r1BF0OLwHiPZ6yzLwkQKGcfNomzuiydAoEO79UjCrODDn7dnZePccS BMPWAMpp2YuQ1auDkzpB6I32kjUqtsn/ftAWvvb8fyVU+LctSCIIt4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=JCxJq3xYUUap0ILOvRCiwKFoSf4=; b=EFpfVf4PskeoSm7Gd/g7KPDmU5lm 4nVKM93FThqalTQVa8rk1k556xCMnvQfDOlZmWvKzQt1BQ9HgeSti6UqDxyfsU6i RWhd0OLIui2cY0U0qsw2NbWZutk2d17+WXM0adQUj9ae7EtNv/gpeGgzaXLbf1Z9 8bkflfwrKXEyY/8= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 Date: Mon, 2 Mar 2020 17:48:51 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Change in logical link behaviour Message-ID: <20200302164851.GS4045@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <30792264-c452-7ea2-c83f-f368322387ea AT emrich-ebersheim DOT 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> --avNtfD0ffNO6L/9g Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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" -----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--