WSL: Symbolic Links With Terminating Slash Don't Function Properly
Brief Description: I was trying to create a symbolic link to a specific directory on the Windows mount to my home dir for convenience. I did this using auto complete with a TAB (which added a terminating slash). Then I quickly discovered that the symbolic link created was only ever returning the dir that was directly linked to (never anything deeper - even if specify an invalid path). I fixed this by creating the link without the terminating slash, and that worked fine. However, I still wanted to report the problem in case it helps in some other context, or just so others know about this odd behavior. See commands below to see what I mean.
Windows build number: 14388.0
Commands to Reproduce the Error:
rcardillo@LAPDOG:~$ ln -s /mnt/c/WORK_REPO/ ~/WORK_REPO
rcardillo@LAPDOG:~$ ls -al ~/WORK_REPO
lrwxrwxrwx 1 rcardillo rcardillo 17 Jul 13 01:20 /home/rcardillo/WORK_REPO -> /mnt/c/WORK_REPO/
rcardillo@LAPDOG:~$ ls -al /mnt/c/WORK_REPO/github/
total 4
drwxrwxrwx 2 root root 0 Jul 13 00:56 .
drwxrwxrwx 2 root root 0 Jul 13 00:32 ..
rcardillo@LAPDOG:~$ ls -al ~/WORK_REPO/github/
total 44
drwxrwxrwx 2 root root 0 Jul 13 00:32 .
drwxrwxrwx 2 root root 0 Jul 13 00:32 ..
drwxrwxrwx 2 root root 0 Jul 13 00:32 angular-1.3.5
drwxrwxrwx 2 root root 0 Jul 13 00:32 angular-1.3.5.zip
drwxrwxrwx 2 root root 0 Jul 13 00:32 bootstrap-3.3.1-dist
drwxrwxrwx 2 root root 0 Jul 13 00:32 github
drwxrwxrwx 2 root root 0 Jul 13 00:32 MediaHelpers
rcardillo@LAPDOG:~$ ls -al ~/WORK_REPO/github/any/thing/else
total 44
drwxrwxrwx 2 root root 0 Jul 13 00:32 .
drwxrwxrwx 2 root root 0 Jul 13 00:32 ..
drwxrwxrwx 2 root root 0 Jul 13 00:32 angular-1.3.5
drwxrwxrwx 2 root root 0 Jul 13 00:32 angular-1.3.5.zip
drwxrwxrwx 2 root root 0 Jul 13 00:32 bootstrap-3.3.1-dist
drwxrwxrwx 2 root root 0 Jul 13 00:32 github
drwxrwxrwx 2 root root 0 Jul 13 00:32 MediaHelpers
rcardillo@LAPDOG:~$
Notice how in the first command, I demonstrate that the github directory is actually empty, but when I use the symbolic link, it returns the contents of the directory that the link points to. Likewise, event when I specify an invalid path, it will always return the contents of the directory the link points to.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 23 (8 by maintainers)
Thanks for reporting this issue, this issue has been fixed internally and will be in a future flight.
Doh! @onomatopellan, you are correct. When testing I ran
ln -s /mnt/c/tmp ~/tempinstead ofln -s /mnt/c/tmp/ ~/temp. Forgot the all important ‘/’ at the end of tmp. Output between the two on 14901:This is fixed on an internal build. Should hit an Insider build before too long:
Thank you for reporting this, this is definitely a bug. I’ve filed a bug internally and will start taking a look at a fix.
The team’s focus is on providing new functionality and fixes to the Windows Insider builds. Only security updates and very select fixes will be pushed out through Windows Update to the 14393.x builds. We discuss this a bit on our WSDL blog here.
According to https://msdn.microsoft.com/en-us/commandline/wsl/release_notes, this is fixed in Build 14905.
@russalex
Guess what. I did the OPPOSITE of this and it worked for me. Omitting the slash after tmp made it work flawlessly. Go figure.
Hey, This is fixed in creators (Now that I updated).
On Tue, May 2, 2017 at 3:58 PM, Jack Hammons notifications@github.com wrote:
–
Derek Riemer: Improving the world one byte at a time!
Personal website http://derekriemer.com