From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) by sourceware.org (Postfix) with ESMTPS id F3808385E006 for ; Thu, 26 Mar 2020 23:52:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F3808385E006 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=towo.net Authentication-Results: sourceware.org; spf=none smtp.mailfrom=towo@towo.net Received: from [192.168.178.45] ([95.90.246.248]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Macf4-1jpJUG1O0o-00c7Y9 for ; Fri, 27 Mar 2020 00:52:18 +0100 Subject: Re: WSL symbolic links To: cygwin@cygwin.com References: <294944bd-757e-4bb8-6bcc-ceb8d9190ef9@towo.net> <20200326110059.GG3261@calimero.vinschen.de> <901e1c08-46cb-555b-c0d0-5bf9c726b3ca@SystematicSw.ab.ca> <20200326195615.GJ3261@calimero.vinschen.de> From: Thomas Wolff X-Tagtoolbar-Keys: D20200327005217408 Message-ID: <8e330046-97bb-ba3e-15dc-25aedf915d90@towo.net> Date: Fri, 27 Mar 2020 00:52:17 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200326195615.GJ3261@calimero.vinschen.de> X-Provags-ID: V03:K1:UFpoDTYVBZxEpHlJcIzhYit/Voav5n+3wslltNqkyNuUzUONNMN NGxiPO/ww2GnMyW4eT+6uBDufMnKjhpfOfWGj3+JDiNn8YcsqWn99ponE9FoMvZP5P5RXii nQx2d1ePd8xZxui9suFwaKfgiPx0sF88YEYeXumpOAKHQVkWBx1kxmrQ7MMCPrSlma8bC4D JPdMjwJkqEL3DrtDVClXA== X-UI-Out-Filterresults: notjunk:1;V03:K0:lDA6pRvWJPg=:Q23yq2lfvxJqz/bRh4RoAq OQpNt+newhSSFooajHPh90kJTc/rLAZXcbD7DxC737h+z8uLi1YeGWsTADTrL2F/QijYnsH/O WNtAathMe/XQZ/vdCKl9iRb+yYG0aoA9n0ALxHl2/zKHnmhFepH2jIbynyWeDdlAMYKBLumYd jI5FI03i6biqWpC2kAqvUyAnVSG+LFZjYHZ6eD/WXGAadP/2DLbd3YLEGly5b/jUXTLr/QUmI XbMgGPLpIIcOIOYj6uds34+fOcxpHqiTy1E+naZfErs3Q2CxnZ7ne5P2GtcR3RojIbyXu7YbK v+XbO6pGJM7jBrauxfR1/skbYbGsFH8imKDr9aj7W5M3+faCz+B6b+kr+pUrdaimaK5f/s2h6 PNNaEqAiA1tsJUms+fzrNJqjkwn3bCMXr54bzH87yyScLCqXUtSmU2wWsxHJQFqFMASPYQl7S n2xq7RrXw4RuIpfWUFU6eHZqq/Orj7oY/7Au9JEDjv4DtthxgSrCkxD/2XuYOMSnwR1/f3sid w3fDR3gIhOoTiwlUQtAn6O3/iTg6X+YjWaNtU8v6RuH4dmR+gnJeFDKV5rHIupc6aJfcuKKUo B478rFgHhHisyZoGoylrSTSc34Efiz8lvHkQhzbLpp0SpllJe65GWGdjZk0llEoSuU8DApLMe 2aLUGLszxOK4CvuRN9CKDxRQjIG49pjhdoOW290EzXWXIhuzL3T02pWH/Ax2CXuMoPIQkcMZW yrwTQ70CPwBEYB2FokzelfO9PrNvKGK4PFYzEJ8B23cywIxFpZfi3hT063+2kteeQn3YsQbuO aqDdiefJvkZwTACDdmbOddncuLN9oEUZxezDf6Y66opeTKJgDg= X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, BODY_8BITS, GARBLED_BODY, GIT_PATCH_2, HTML_MESSAGE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Mar 2020 23:52:22 -0000 Am 26.03.2020 um 20:56 schrieb Corinna Vinschen: > Brian and Thomas, > > > Thanks to both of you for providing this info. > > > On Mar 26 13:12, Brian Inglis wrote: >> On 2020-03-26 05:00, Corinna Vinschen wrote: >>> On Mar 26 10:00, Thomas Wolff wrote: >>>> A symbolic link created with WSL is neither interpreted in cygwin nor can it >>>> be deleted: >>>>> touch file >>>>> wsl ln -s file link >>>>> wsl ls -l link >>>> lrwxrwxrwx    1 towo     towo             1 Mar 26 08:56 link -> file >>>>> ls -l link >>>> -rw-r----- 1 Unknown+User Unknown+Group 0 Mar 26 00:00 link >>> What kind of file are they in the real world? Reparse points? If so, >>> what content do they have? I attached a Q&D source from my vault >>> of old test apps to check on reparse point content. Please compile with >>> gcc -g ../src/rd-reparse.c -o rd-reparse -lntdll >>> It takes a single native NT path as parameter, kind of like this: >>> ./rd-reparse '\??\C:\cygwin64\home\corinna\link' >> They should be WSL or Windows mklink (soft) links, and the reason why mklink was >> allowed unelevated in Windows 10 with Developer mode. >> >> In an *elevated* shell: >> >> $ ls -dln u >> -rw-r----- 1 4294967295 4294967295 0 Nov 9 06:09 u >> $ getfacl u >> getfacl: u: Permission denied >> $ icacls u >> u NULL SID:(DENY)(Rc,S,REA,WEA,X,DC) >> $HOSTNAME\$USER:(F) >> $HOSTNAME\$USER:(RX,W,DC) >> BUILTIN\Users:(Rc,S,RA) >> BUILTIN\Administrators:(RX,W,DC) >> BUILTIN\Users:(DENY)(S,RD,REA,X) >> Everyone:(RX) >> NT AUTHORITY\SYSTEM:(I)(F) >> BUILTIN\Administrators:(I)(F) >> $HOSTNAME\$USER:(I)(F) >> >> Successfully processed 1 files; Failed processing 0 files >> $ ./rd-reparse '\??\C:\...\u' >> ReparseTag: 0xa000001d > ^^^^^^^^^^ > > 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. > > Unfortunately I don't see a definition of the reparse point data for > that reparse point type. > > 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. > > 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? > > - 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. > > - A symlink with a target path pointing to a remote file (what syntax > does this use?) > > - 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: > wsl -d Ubuntu ls -l link* lrwxrwxrwx 1 towo towo  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  5 Mar 27 00:39 link-foo -> föö lrwxrwxrwx 1 towo towo 16 Mar 27 00:39 link-foo-abs -> /mnt/c/tmp/föö > rd-reparse '\??\C:\tmp\link' ; echo ReparseTag:           0xa000001d ReparseDataLength:             8 Reserved:                      0 02 00 00 00 66 69 6c 65 > rd-reparse '\??\C:\tmp\link-abs' ; echo ReparseTag:           0xa000001d ReparseDataLength:            19 Reserved:                      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:           0xa000001d ReparseDataLength:             9 Reserved:                      0 02 00 00 00 66 c3 b6 c3 b6 > rd-reparse '\??\C:\tmp\link-foo-abs' ; echo ReparseTag:           0xa000001d ReparseDataLength:            20 Reserved:                      0 02 00 00 00 2f 6d 6e 74 2f 63 2f 74 6d 70 2f 66 c3 b6 c3 b6 > If the link name itself contains non-ASCII, rd-reparse fails with NtOpenFile: C0000034 > 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. Thomas > > > Thanks, > Corinna > > > -- > 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