Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cygwin: path_conv: Try to handle native symlinks more sanely #38

Merged
merged 1 commit into from
May 1, 2021

Conversation

orgads
Copy link
Contributor

@orgads orgads commented Apr 29, 2021

For local paths, add a check if the inner path components contain native
symlinks or junctions. Compare the incoming path with the path returned
by NtQueryInformationFile(FileNameInformation). If they differ, there
must be at least one native symlink or junction in the path. If so,
treat the currently evaluated file as non-existant. This forces
path_conv::check to backtrack inner path components until we eliminated
all native symlinks or junctions and have a normalized path.

Signed-off-by: Corinna Vinschen corinna@vinschen.de
(cherry picked from commits 456c3a4 and
13fd26e)

For local paths, add a check if the inner path components contain native
symlinks or junctions.  Compare the incoming path with the path returned
by NtQueryInformationFile(FileNameInformation).  If they differ, there
must be at least one native symlink or junction in the path.  If so,
treat the currently evaluated file as non-existant.  This forces
path_conv::check to backtrack inner path components until we eliminated
all native symlinks or junctions and have a normalized path.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
(cherry picked from commits 456c3a4 and
13fd26e)
@lazka
Copy link
Member

lazka commented Apr 29, 2021

Thanks

@lazka lazka merged commit 517744e into msys2:msys2-3_2_0-release May 1, 2021
@orgads orgads deleted the realpath-link branch May 1, 2021 18:05
@jeremyd2019
Copy link
Member

I think this has broken the ability to work with substed drives

$ subst
T:\: -> C:\blah\blah\MINGW-packages

$ ls /t/
ls: cannot access '/t/': No such file or directory

This worked fine with 3.2.0-3

@orgads
Copy link
Contributor Author

orgads commented May 4, 2021

Thanks for the report. I passed it on to cygwin mailing list.

Ah, now I see you already did :)

@jeremyd2019
Copy link
Member

How important is this patch? I use subst all the time for building packages, as a way to shorten paths, so this is pretty much a showstopper for me (to keep me from updating msys2-runtime until this is fixed).

@jeremyd2019
Copy link
Member

Well, I tried to but I never saw it show up in the archives so assumed it went to the black hole. But wait, figured out my problem, I was still on the April page 😊

@orgads
Copy link
Contributor Author

orgads commented May 4, 2021

I needed it mostly to make cmake tests pass. Let's give them 2-3 days to reply. If they don't, we can revert it.

@orgads
Copy link
Contributor Author

orgads commented May 4, 2021

Notice that they usually don't CC the author on reply, so if you haven't subscribed to the mailing list, you won't get notified. You need to open the archives once in a while to see if you have a reply.

@jeremyd2019
Copy link
Member

That was my problem, I had the archives page open in a tab to periodically refresh and see if anything interesting to me showed up, but I didn't notice I was still on the April page now that it's May

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants