[PATCH v2] Cygwin: respect PC_SYM_FOLLOW and PC_SYM_NOFOLLOW_REP with inner links

Corinna Vinschen corinna-cygwin@cygwin.com
Mon May 31 08:17:44 GMT 2021

On May 31 10:02, Corinna Vinschen wrote:
> On May 30 12:58, Jeremy Drake via Cygwin-patches wrote:
> > First, revert the handling of virtual drives as non-symlinks.  This is no
> > longer necessary.
> I'm all for it, because I like the idea that Cygwin can see virtual
> drives as symlinks, but...
> > The new GetFinalPathNameW handling for native symlinks in inner path
> > components is disabled if caller doesn't want to follow symlinks, or
> > doesn't want to follow reparse points.  Set flag to not follow reparse
> > points in chdir, allowing native processes to see their cwd potentially
> > including native symlinks, rather than dereferencing them.
> So you're trying to keep the path length of the native CWD below
> MAX_PATH?  I understand what you're trying to accomplish, but are
> you sure this doesn't break Cygwin processes?  The idea of what
> the native path of a directory is differs depending on calling
> chdir and stuff like mkdir.

What bugs me here is that there's no guarantee that you can keep your
path below MAX_PATH, independently of what you do here.  This is all
a bit like patching up left and right just to keep dumb native tools
running even in scenarios where they just fail otherwise.

So we have two contradict problems, one which is solved by following
inner symlinks, one which is solved by not doing that... I'm not overly
keen to support this scenario.

Wouldn't that be something more suited for an MSYS2-local patch?


More information about the Cygwin-patches mailing list