delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/03/27/07:21:59

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CEFC9385E011
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1585308081;
bh=/VUyDUDRTSbyQnL5lRnT32pw5UBDglWZuKXlc7l7b4Q=;
h=Date:From:To:Subject:References:In-Reply-To:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
Reply-To:From;
b=ZPnh8lTLv8Aa5ylZmVboW6CURUY2f2R9q58+p6p8VQV4iVKqauKfCp5gHKa/LqrAw
b3fKhMVDKa9QOlFjBQJsY3OB+4dZ8qXBG+oH2Rnz+rt8uxp6FnZh+ugE7Ad7zw1zln
w4b85p/SSkDLDtqJLsW9r6ee2evwBlRvRt52gqfg=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D728F385E006
Authentication-Results: sourceware.org;
dmarc=none (p=none dis=none) header.from=cygwin.com
Authentication-Results: sourceware.org;
spf=fail smtp.mailfrom=corinna-cygwin AT cygwin DOT com
Date: Fri, 27 Mar 2020 12:21:15 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: WSL symbolic links
Message-ID: <20200327112115.GL3261@calimero.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <294944bd-757e-4bb8-6bcc-ceb8d9190ef9 AT towo DOT net>
<20200326110059 DOT GG3261 AT calimero DOT vinschen DOT de>
<901e1c08-46cb-555b-c0d0-5bf9c726b3ca AT SystematicSw DOT ab DOT ca>
<20200326195615 DOT GJ3261 AT calimero DOT vinschen DOT de>
<8e330046-97bb-ba3e-15dc-25aedf915d90 AT towo DOT net>
MIME-Version: 1.0
In-Reply-To: <8e330046-97bb-ba3e-15dc-25aedf915d90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kPzoJE9EN6xzkDPEJI4mVEHZhWLtWnDtOtrQN
854vu1pEN9vH6y7VsCYcoS+XsTKKbrK57uD6TwKpkfPoLJkohHA4Q5G2NTGQu942QywTqHf
X-Spam-Status: No, score=-82.3 required=5.0 tests=BAYES_00, BODY_8BITS,
GARBLED_BODY, GOOD_FROM_CORINNA_CYGWIN, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS,
RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NEUTRAL,
TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-Unsubscribe: <http://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <http://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: <http://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Reply-To: cygwin AT cygwin DOT com
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

--===============8588179125460809529==
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="QxIEt88oQPsT6QmF"
Content-Disposition: inline


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

On Mar 27 00:52, Thomas Wolff wrote:
> Am 26.03.2020 um 20:56 schrieb Corinna Vinschen:
> > This is a reparse point tag different from the normal Windows symlink
> > reparse point tag, 0xa000000c.  Searching for this value shows this
> > is defined in ntifs.h as IO_REPARSE_TAG_LX_SYMLINK.
> >=20
> > Unfortunately I don't see a definition of the reparse point data for
> > that reparse point type.
> >=20
> > In your examples the data part looks like a 4 byte int value, being 2 in
> > both of your examples, maybe a file type, followed by the path in
> > multibyte, no trailing \0.
> >=20
> > Unfortunately, in both cases the path is relative, just the file name it
> > points to.  To get more information, could one of you two please create
> > a few more symlinks?
> >=20
> > - A symlink pointing to a local path, given in absolute path syntax.
> >    I assume the path will be in POSIX syntax, contain slashes, but it
> >    would be helpful to see it.
> >=20
> > - A symlink with a target path pointing to a remote file (what syntax
> >    does this use?)
> >=20
> > - Last but not least, could you please create a symlink pointing to a
> >    target with a non-ASCII char, e. g., some german umlaut?
> Not sure what kind of remote you'd like to see. I have a 'net use'
> (cifs/smbfs) mounted drive but couldn't mount it in WSL. Otherwise:
>=20
> > wsl -d Ubuntu ls -l link*
> lrwxrwxrwx 1 towo towo=C2=A0 4 Mar 27 00:31 link -> file
> lrwxrwxrwx 1 towo towo 15 Mar 27 00:31 link-abs -> /mnt/c/tmp/file
> lrwxrwxrwx 1 towo towo=C2=A0 5 Mar 27 00:39 link-foo -> f=C3=B6=C3=B6
> lrwxrwxrwx 1 towo towo 16 Mar 27 00:39 link-foo-abs -> /mnt/c/tmp/f=C3=B6=
=C3=B6
> > rd-reparse '\??\C:\tmp\link' ; echo
> ReparseTag:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0=
xa000001d
> ReparseDataLength:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 8
> Reserved:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0
> 02 00 00 00 66 69 6c 65
> > rd-reparse '\??\C:\tmp\link-abs' ; echo
> ReparseTag:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0=
xa000001d
> ReparseDataLength:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 19
> Reserved:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0
> 02 00 00 00 2f 6d 6e 74 2f 63 2f 74 6d 70 2f 66
> 69 6c 65
> > rd-reparse '\??\C:\tmp\link-foo' ; echo
> ReparseTag:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0=
xa000001d
> ReparseDataLength:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 9
> Reserved:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0
> 02 00 00 00 66 c3 b6 c3 b6
> > rd-reparse '\??\C:\tmp\link-foo-abs' ; echo
> ReparseTag:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0=
xa000001d
> ReparseDataLength:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 20
> Reserved:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0
> 02 00 00 00 2f 6d 6e 74 2f 63 2f 74 6d 70 2f 66
> c3 b6 c3 b6

Thanks!  In the meantime I could fix my problems with the Windows Store
and was finally able to install WSL for further testing.  See below.

> If the link name itself contains non-ASCII, rd-reparse fails with
> NtOpenFile: C0000034

Yeah, that's expected.  The test app only handles filename with ASCII
chars.

> > It's questionable if supporting this new symlink type makes sense, but
> > taking a closer look doesn't hurt, I guess.
> Well, at least they should be deletable, I think.

I debugged this now and I found that practically all problems, including
the inability to delete the symlink, are a result of not being able to
open the reparse point correctly as reparse point within Cygwin.  So as
not to destroy something important, Cygwin only opens reparse points as
reparse points if it recognizes the reparse point type.

Consequentially, all immediate problems go away, as soon as Cygwin
recognizes and handles the symlink :)

So I created a patch and pushed it.  The latest developer snapshot from
https://cygwin.com/snapshots/ contains this patch.

Funny sidenote: Assuming you create symlinks pointing to files with
non-UTF-8 chars, e. g., umlauts in ISO-8859-1, then the symlink converts
*all* these chars to the Unicode REPLACEMENT CHARACTER 0xfffd.  I assume
this will also happen if you try to create the file with these chars in
the first place, so it's not much of a problem.


Corinna

--=20
Corinna Vinschen
Cygwin Maintainer

--QxIEt88oQPsT6QmF
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl594asACgkQ9TYGna5E
T6Dnlg/+L56SOXTeBdFL3sMSLdxRkIGlSVhmENERCaMzCPw4bZwqsClQ6E6KaC2b
m8nvEF1RoMWuQEm3FtzDy70CTEN/cTi8WPyxRLTGdU2s095gVut6/IbLbnHRIPTX
iBuvHG80BOuF7jbShLFlksmZkWeqQIRq7Ok2+fzloFuV90Pxta/NILKd2rVBBPdw
GBYTc0MRTGVCr13M0Yla/ppRxUvrjBBs3L3hvXtiSjb9cgMa9FuWymJKm+VjbVTK
LfPdMVoLyT7J7ZfJ7WiF3aD4HMaAudUT9gpJ5r0US1Jp6vbHuu3AtcgZEdcPvRDR
LWuXB+DQgiDh85KKY9Zaq8qN/IjP7HX/4IsAWwn/eAblqx8tjiOrkLPwHNERejZj
z36SpdctsZEkXsjk0aQ6eZVlpoIsjb1nkMD8UUJcMWgPWqki/Fw9xwjnx9FAibbo
9lfHAr5nf/KpqsttZ1MOmyFj1v7oThi2L1gjWZNZGKIj/o8u5CpKlNqbrY5wqk3M
dpjo2IRDMR0kMjMOGDt8NB2dlkvF+HLaqFCfghh63ngfk5BI1/MgpOBkR//X420f
U6K5x/7miuB2FC3bnEP0qQ5NrmFiUVJNLpYSXYdTrd5T7d3yPBE0YTRZ+bxG8lmF
lqGzt2Dr6x5bQandGSYHeXF0BGKpC5l9JnOzgCoY14zifZL6nAU=
=ZW+j
-----END PGP SIGNATURE-----

--QxIEt88oQPsT6QmF--

--===============8588179125460809529==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

--===============8588179125460809529==--

- Raw text -


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