-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Return EISDIR when trying to create a path ending in / with open #23135
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
Conversation
If we open a path that in a / and we're about to create a file, instead return EISDIR.
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.
lgtm % comments
It looks like this test is failing with ASan: It looks like there's a null deref in open(). It may very well be pre-existing, but just exposed by this test. |
I'll look into it (unless someone else fixes it first). |
This is enough to reproduce the asan failure: #include <fcntl.h>
int main() {
open("./does-not-exist/", O_CREAT);
} |
Can you share the command line flags needed? |
Oh thats because if you specify
|
From https://man7.org/linux/man-pages/man2/open.2.html:
|
If we open a path that in a / and we're about to create a file, instead return EISDIR.