realpath issue with native[strict] symlinks
Corinna Vinschen
corinna-cygwin@cygwin.com
Wed May 19 12:42:49 GMT 2021
On May 18 13:01, Jeremy Drake via Cygwin wrote:
> Sorry ,forgot subject
>
> On Tue, 18 May 2021, Jeremy Drake wrote:
>
> > > Sorry, but there's only this or that, not both. Either we revert the
> > > entire change, including the native shortcut stuff, or we do it
> > > completely and fully, including handling virtual drives as symlinks.
> >
> > I had success with just the following change (of course comments would
> > also need to be updated):
> >
> > diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
> > index 4ebaf4dc6..53534b8b6 100644
> > --- a/winsup/cygwin/path.cc
> > +++ b/winsup/cygwin/path.cc
> > @@ -3670,8 +3670,7 @@ restart:
> > somewhere else, thus, it's a symlink in POSIX speak. */
> > if (upath.Length == 14) /* \??\X:\ */
> > {
> > - fileattr &= ~FILE_ATTRIBUTE_DIRECTORY;
> > - path_flags |= PATH_SYMLINK;
> > + goto file_not_symlink;
> > }
> > /* For final paths differing in inner path components return
> > length as negative value. This informs path_conv::check
> >
> > Treating mapped/subst drives as though they were not symlinks, without
> > messing with intermedate symlinks.
It was that simple, surprise, surprise...
I pushed the change under your name.
Thanks,
Corinna
More information about the Cygwin
mailing list