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

Check symlink relative flag and use correct offsets on Windows #74

Merged
merged 2 commits into from
Oct 10, 2020
Merged

Check symlink relative flag and use correct offsets on Windows #74

merged 2 commits into from
Oct 10, 2020

Conversation

Ziink4
Copy link
Contributor

@Ziink4 Ziink4 commented Oct 9, 2020

Hello,
Some symbolic links might incorrectly be reported as missing when Windows reports the pointed file as a relative path instead of absolute

The SymbolicLinkReparseBuffer structure has a special flag to indicate whether or not the result is relative or absolute.
I also switched from PrintNameOffset to SubstituteNameOffset because of this :

A symbolic link has a substitute name and a print name associated with it. The substitute name is a pathname (section 2.1.5) identifying the target of the symbolic link. The print name SHOULD be an informative pathname, suitable for display to a user, that also identifies the target of the symbolic link.

Reference : https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/b41f1cbf-10df-4a47-98d4-1c52a833d913

Copy link
Owner

@gulrak gulrak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there is something wrong here, I guess one of the parameters should have been SubstituteNameLength on both changes, as it was before with PrintNameLength. That might be the reason all Windows pipelines fail with some tests with these changes.

@Ziink4
Copy link
Contributor Author

Ziink4 commented Oct 9, 2020

You're right, what's intriguing to me is that on my Windows machine (running VS 2019), all the tests were passing just fine.

@gulrak
Copy link
Owner

gulrak commented Oct 9, 2020

I updated the master to do additional preparation of windows native paths that should help your PR. Can you try to incorporate it into your version to hopefully get the CI green? Tests fail on my Windows 10 with VS2019 too, not only CI.

@gulrak gulrak added this to the v1.3.6 milestone Oct 10, 2020
@gulrak gulrak merged commit c82e11a into gulrak:master Oct 10, 2020
@gulrak
Copy link
Owner

gulrak commented Oct 10, 2020

Thanks for the contribution, I checked the combination of my prefix handling and your PR together and tests looked good. Will be in the upcoming release this weekend.

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

2 participants