-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
File.mkdir_p: Fix TOCTOU issue & handle errors from parent mkdir
Fix TOCTOU, meaning :file.make_dir returning {:error, :eexists} is now tested without having to trigger a race-condition. Also change dir?() returning false from returning :eexist to :enotdir And handling errors from parent directory creation allows to avoid non-sensical errors like File.mkdir_p returning :enoent instead of :eacces
- Loading branch information
Showing
2 changed files
with
36 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters