-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libstd: explicitly disallow io::fs::File to open a directory.
On *BSD systems, we can open(2) a directory and directly read(2) from it due to an old tradition. We should avoid doing so by explicitly calling fstat(2) to check the type of the opened file. Opening a directory as a module file can't always be avoided. Even when there's no "path" attribute trick involved, there can always be a *directory* named "my_module.rs". Fix #12460 Signed-off-by: NODA, Kai <nodakai@gmail.com>
- Loading branch information
Showing
2 changed files
with
23 additions
and
11 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
3980cde
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.
saw approval from alexcrichton
at nodakai@3980cde
3980cde
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.
merging nodakai/rust/libsyntax-reject-dirs = 3980cde into auto
3980cde
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.
nodakai/rust/libsyntax-reject-dirs = 3980cde merged ok, testing candidate = 361baab
3980cde
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.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/2563
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/2560
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/2553
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/2560
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/2555
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/2553
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/2553
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/2557
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/2550
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/2549
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/2552
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/2214
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/2211
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/2216
success: http://buildbot.rust-lang.org/builders/auto-win-64-opt/builds/1053
success: http://buildbot.rust-lang.org/builders/auto-win-64-nopt-t/builds/1047
success: http://buildbot.rust-lang.org/builders/auto-win-64-nopt-c/builds/1043
3980cde
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.
fast-forwarding master to auto = 361baab