-
Notifications
You must be signed in to change notification settings - Fork 87
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
Fix broken symlink traversal issue #60
base: master
Are you sure you want to change the base?
Conversation
- Fallback to fs.lstat if fails (fs.stat fails for broken symlinks cause it looks up for original target, wherease fs.lstat only returns stat for the symlink file instead of looking up original)
- For broken symlinks stats might be undefined and in other cases isSymbolicLink is available instead of isDirectory - Broken symlink will be added to files list as expected
@jergason can you please take a look and let know what do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dibosh Looks great! I came across a similar issue and developed a solution before realizing that you beet me too it 😄 I approve these changes however, it looks like the maintainer @jergason is not active? I guess that is why there are so many forks.
@jrtechs haha! You are right- I wish there was one more maintainer and it was merged into the original one, am sure the more people will use it, the more they will end up in such cases. |
@jergason nudge after another couple years! Can this be merged? Or is it fixed already in any of the latest release? I would be happy to close it if it's not relevant anymore. |
This issue #42 is pretty frequent in MacOSX and this is another stab at fixing the issue.
Has similar
lstat
approach as first appeared in #51, but addresses the problem without replacing/editing much code and keeping a minimal footprint yet similar signature in a refactored method.Also, the expected behaviour for a broken symlink should be- if it was not possible to dive into it, then don't do it but add it to returned file list(instead of expecting some sort of check in provided
ignores
). Which is the exact behaviour in this PR.