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

Following symlinks is a questionable default #61

Closed
cuviper opened this issue Sep 19, 2022 · 4 comments
Closed

Following symlinks is a questionable default #61

cuviper opened this issue Sep 19, 2022 · 4 comments
Assignees

Comments

@cuviper
Copy link

cuviper commented Sep 19, 2022

I tried kondo in my home directory, and it ended up scanning everything due to a symlink:

'Steam/steamapps/common/Proton 7.0/dist/share/default_pfx/dosdevices/z:' -> /

It was taking a really long time, so I ran strace and found that it was lost somewhere in .../z:/proc. I know there are symlink loops in procfs, and I think walkdir is supposed to detect loops, so maybe it would have figured that out eventually. Still, I don't think it's a good default to follow links, and other tools I know like fd-find and dua-cli do not.

Semi-related, you might also want an option for same_file_system, but that's less clear as a default.

@tbillington
Copy link
Owner

Oh, nasty. Thank you for raising this.

I'm of the mind to change symlinks to default nofollow, and expose the option with a flag.

I don't have much experience with multiple filesystems, I don't see an immediate issue with allowing crossing filesystem boundaries if they're within the directories you've specified. This could be a flag too!

I've been planning out a refactor, so these will get some attention.

@tbillington tbillington self-assigned this Sep 19, 2022
@cuviper
Copy link
Author

cuviper commented Sep 19, 2022

Thanks for a quick reply!

For precedent, -L is a common option flag for following links. I'm not sure what situation you'd really want that for this tool, but I see no problem with making it possible for a user who does.

The filesystem thing is more niche, to be sure, especially if you're not following links.

@JohnTheCoolingFan
Copy link

I agree that kondo dhouldn't follow symlinks by default or at least have an option to disable such behavior, or have an option to exclude certain directories from searching. Same situation as issue opener, scanned my proton prefixes.

@tbillington
Copy link
Owner

Thanks for raising this issue! I've disabled symlink following by default, you'll now be able to opt-in via a CLI flag.

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

3 participants