delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/03/03/08:40:14

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=sylDB1siSUXtLWhCa/wBuNcFtjmLh1QVOWPw64BwLTJ/U4O/pTKyF
oWu60GoS+ZcXpl/XQjdFUW6gINVwCw6WEobYNbGJhULShJEzIXUvZXEtXZlR0oBd
3U23VcqUx9NtyxsfssZV6ccnoipkbzELcFcqLw9LdlYtMXlJLAzwD8=
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=QCS9717pRXCe+9PgOvfPyXqJqi4=; b=U7sAsROWzVMn455hNRHq8CWQAhl4
QzjD+3voUdLXo0DdfchwCHBiX265bqgYpzuuzve3fr6vMnYr5bKCLsp7NNJ4ocha
WPK296QyN4CnskkgDZ087iAVEg03H2BaqDGeiRyQpy/ZcN8rRlrStZ5wdEXEDg/g
WtBpBvexfjp+8gE=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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.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
Date: Tue, 3 Mar 2020 14:39:25 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Change in logical link behaviour
Message-ID: <20200303133925.GA4045@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> <20200302164851 DOT GS4045 AT calimero DOT vinschen DOT de> <d04228d9-eff9-6dd4-6cfc-80b24bc8fa3b AT emrich-ebersheim DOT de>
MIME-Version: 1.0
In-Reply-To: <d04228d9-eff9-6dd4-6cfc-80b24bc8fa3b@emrich-ebersheim.de>

--1IYcr18XUmgwOrO2
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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    <DIR>          .
> >   2020-03-02  17:31    <DIR>          ..
> >   2020-03-02  17:31    <SYMLINK>      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    <SYMLINK>      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    <SYMLINK>      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    <SYMLINK>      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"

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019