Check symlink relative flag and use correct offsets on Windows by Ziink4 · Pull Request #74 · gulrak/filesystem · GitHub
Skip to content

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

Merged
gulrak merged 2 commits into
gulrak:masterfrom
Ziink4:master
Oct 10, 2020
Merged

Check symlink relative flag and use correct offsets on Windows#74
gulrak merged 2 commits into
gulrak:masterfrom
Ziink4:master

Conversation

@Ziink4

@Ziink4 Ziink4 commented Oct 9, 2020

Copy link
Copy Markdown
Contributor

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

@gulrak gulrak left a comment

Copy link
Copy Markdown
Owner

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

Ziink4 commented Oct 9, 2020

Copy link
Copy Markdown
Contributor Author

@gulrak

gulrak commented Oct 9, 2020

Copy link
Copy Markdown
Owner

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

gulrak commented Oct 10, 2020

Copy link
Copy Markdown
Owner

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.

2 participants