Skip to content

glob: skip already-walked dirs in ** expansion - #116

Open
team-humaki wants to merge 1 commit into
bmatcuk:masterfrom
team-humaki:fix-filepathglob-parent-symlink
Open

team-humaki wants to merge 1 commit into
bmatcuk:masterfrom
team-humaki:fix-filepathglob-parent-symlink

Conversation

@team-humaki

Copy link
Copy Markdown

A symlink to a parent directory made ** walk forever.

Mark each directory after Stat and skip it if os.SameFile says we have already been there. FilepathGlob("link-to-parent/") and FilepathGlob("") in a tree with such a link now return.

Fixes #104

FilepathGlob hung when a symlink pointed at a parent directory.
Track visited inodes via os.SameFile and do not recurse into a
directory a second time.

Fixes bmatcuk#104
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.

FilepathGlob enters infinite loop when following symlinks pointing to parent directories

1 participant