-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Dir.makePath infinite loops when a path component is a symlink #17330
Comments
I reproduced this, but this comment in
Note that valid symlinks don't have this problem, just dangling ones. |
If a directory in a makePath() call already exists, use statFile() to check what it is. If its a Directory, that's okay. If its "not found", that implies its a dangling symlink, other kinds of files are assumed to be not okay. Also add several more tests for makePath. Fixes ziglang#17330
If a directory in a makePath() call already exists, use statFile() to check what it is. If its a Directory, that's okay. If its "not found", that implies its a dangling symlink, other kinds of files are assumed to be not okay. Also add several more tests for makePath. Fixes ziglang#17330
If a directory in a makePath() call already exists, use statFile() to check what it is. If its a Directory, that's okay. If its "not found", that implies its a dangling symlink, other kinds of files are assumed to be not okay. Also add several more tests for makePath. Fixes ziglang#17330
Info dump of what I've found when looking into this so far on Windows:
This modified test from #17499 succeeds on Windows (
With
This ties into #16738, since For avoiding the infinite loop in the OP, we need to be able to detect dangling symlinks, so the current implementation of Weird side-note about the mkdir util on WindowsThe
and a
then executing the
Gives us the following expected
(it has but also these unexpected
|
Zig Version
0.12.0-dev.163+6780a6bbf
Steps to Reproduce and Observed Behavior
repro.zig
Expected Behavior
It shouldn't infinite loop
It is a valid question whether it should follow the symlink and "continue" creating the directory through the symlink, joining the path. There is an argument for either case.
But it shouldn't infinite loop
The text was updated successfully, but these errors were encountered: