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

continuity.context.Walk assumes incorrect behavior for os.Readlink #232

Open
bcmills opened this issue Oct 24, 2023 · 0 comments
Open

continuity.context.Walk assumes incorrect behavior for os.Readlink #232

bcmills opened this issue Oct 24, 2023 · 0 comments

Comments

@bcmills
Copy link

bcmills commented Oct 24, 2023

The code added in 8100e75 (CC @darstahl) appears to be assuming a behavior of os.Readlink that it does not actually provide, which will almost certainly cause Walk to fail when the root is a relative symlink or symlink-to-symlink on POSIX platforms.

A cleaner fix here is to ensure that the root path passed to filepath.Walk and/or filepath.WalkDir ends with a trailing separator, which (on all POSIX-compliant platforms, and Windows as of https://go.dev/cl/463177) will cause Walk to start walking at the target referred to by the root instead of the root symlink itself.

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

No branches or pull requests

1 participant