public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: "Hans-Bernhard Bröker" <HBBroeker@t-online.de>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH 1/2] Treat Windows Store's "app execution aliases" as symbolic links
Date: Fri, 26 Mar 2021 02:29:30 +0100	[thread overview]
Message-ID: <6ebe672a-0a63-d31b-1a33-084404e29c24@t-online.de> (raw)
In-Reply-To: <e4ce7492-d6dd-2930-2059-888381ac3cff@cornell.edu>

Am 24.03.2021 um 21:58 schrieb Ken Brown:
> On 3/24/2021 2:55 PM, Hans-Bernhard Bröker wrote:
>> Am 23.03.2021 um 10:30 schrieb Corinna Vinschen via Cygwin-patches:
>>  > On Mar 22 22:54, Hans-Bernhard Bröker wrote:
>>  >> Am 22.03.2021 um 16:22 schrieb Johannes Schindelin:

>> It's what WSL Debian creates when I 'ln -s' inside its own filesystem.
>>
>> Windows' own "dir" command shows it as
>>
>> 22.03.2021  22:34    <JUNCTION>     link_to_a [...]
>>
>> But it cannot do anything else with it.  Even fsutil doesn't work on 
>> that thing:
>>
>> C:\prg\test>fsutil reparsePoint query \\wsl$\Debian\home\hbbro
>> Fehler:  Unzulässige Funktion.
> 
> Are you running WSL1 or WSL2?  

To the best of my knowledge it's WSL1.

> I have WSL1, and the stat command such as 
> the one you tried fails in the same way as yours.  Nevertheless, a 
> symlink created under WSL is indeed recognized as such by Cygwin.  I 
> verified this as follows:
> 
> 1. Within WSL,
> 
> $ ln -s foo mysymlink
> $ cp -a mysymlink /mnt/c/cygwin64/tmp

Here it gets a bit weird.  The result of that procedure depends on 
whether the link target, 'foo', exists in cygwin64/tmp prior to running 
the above commands.

If 'foo' exists, the copy of the symlink becomes a Windows native 
symlink (reparse point class 0xa000000c).  If it doesn't the copy turns 
into a reparse point of class 0xa000001d, which 'fsutil reparsepoint 
query' decodes as "name replacement", Cygwin as a (broken) symlink, and 
'dir' lists as <JUNCTION>.  In other words, a WSL symlink.

It's quite strange that copying a native WSL1 symlink from inside WSL's 
own file system out into the Windows side of things does _not_ always 
yield an identical copy.  Some layer sitting between WSL and the Windows 
file system may modify the copy in flight.

The same difference applies if, instead of copying an existing symlink, 
you just have WSL create one directly in the Windows tree, i.e.

	cd /mnt/c/cygwin64/tmp
	rm a b
	touch a
	ln -s a la
	ln -s b lb
	touch b

yields a Windows symlink for 'la', and a WSL symlink for 'lb'.

  reply	other threads:[~2021-03-26  1:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 15:11 Johannes Schindelin
2021-03-12 17:03 ` Joe Lowe
2021-03-14  0:21   ` Johannes Schindelin
2021-03-14  3:41     ` Joe Lowe
2021-03-15  3:19       ` Johannes Schindelin
2021-03-15 19:04         ` Hans-Bernhard Bröker
2021-03-22 15:22           ` Johannes Schindelin
2021-03-22 21:54             ` Hans-Bernhard Bröker
2021-03-23  9:30               ` Corinna Vinschen
2021-03-24 18:55                 ` Hans-Bernhard Bröker
2021-03-24 20:58                   ` Ken Brown
2021-03-26  1:29                     ` Hans-Bernhard Bröker [this message]
2021-03-15 10:17       ` Corinna Vinschen
2021-03-15 19:52 ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ebe672a-0a63-d31b-1a33-084404e29c24@t-online.de \
    --to=hbbroeker@t-online.de \
    --cc=cygwin-patches@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).