vboxsharedfs - Too many levels of symbolic links

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Dec 7 14:57:56 GMT 2021


On Dec  7 09:46, Takashi Yano wrote:
> On Mon, 6 Dec 2021 19:55:27 +0900
> Takashi Yano wrote:
> > First, I think the same. However, with this patch, it sometimes causes
> > hang for a few seconds around the code:
> [...]
> > with path_copy of "//VBoxSrv". I am not sure why.

That's expected and nothing really to worry about.  It's the network
environment access in fhandler_netdrive.

<sidenote>
I have this on the radar already, because the WNet stuff in there has
been broken by Microsoft with certain updates to Windows 10.  A SMB
security fix has deliberately left behind the WNet calls to enumerate
the network environment, because they rely on functionality of older SMB
versions.
</sidenote>

> > 
> > In addition,
> > https://cygwin.com/pipermail/cygwin/2021-December/250103.html
> > still needs fix.
> 
> Moreover, this has a problem with "ls -al /cygdrive/z".
> The information for ".." is not retrieved correctly.
> 
> drwxr-xr-x 1 yano None       0 Dec  6 13:54 .
> d????????? ? ?    ?          ?            ? ..
> -rw-r--r-- 1 yano None      29 Dec  4 07:45 Makefile
> -rw-r--r-- 1 yano None      17 Dec  6 13:18 a
> drwxr-xr-x 1 yano None       0 Dec  6 08:59 aaa
> lrwxrwxrwx 1 yano None       1 Dec  6 13:54 b -> a
> -rwxr-xr-x 1 yano None 3278626 Dec  7 09:07 cygwin0.dll
> -rwxr-xr-x 1 yano None 3549860 Dec  6 08:51 cygwin0.dll.64
> -rw-r--r-- 1 yano None       0 Dec  3 22:16 testfile.txt
> 
> I think '/cygdrive/z/..' should be '/cygdrive', however,
> in current cygwin, it is interpreted into '//VBoxSrv'.
> 
> Is this as you intended?
> 
> With my patch which stops to treat UNC path as symlink,
> '/cygdrive/z/..' returns '/cygdrive'.

Yeah, but...

...what bugs me is that *every* UNC path is treated this way with
that patch.  If you have a path like /cygdrive/x/a/b/c, with x:
being a virtual drive pointing to //server/share, and with "b"
being a symlink to "syml", what you get back is either

  //server/share/a/syml/c

without, or

  /cygdrive/x/a/b/c

with your patch.  What we would like to get back is

  /cygdrive/x/a/syml/c

So the real problem is not that we have an UNC path, but the fact that
the drive letter expression is (correctly, but unwanted) converted to
the matching UNC path by GetFinalPathNameByHandle.

Bottom line is, your patch is ok, please apply.  It would be nice,
though, if we could just avoid the drive: -> UNC path conversion and
keep the rest.


Thanks,
Corinna


More information about the Cygwin mailing list