Return EISDIR when trying to create a path ending in / with open#23135
Return EISDIR when trying to create a path ending in / with open#23135hoodmane merged 10 commits intoemscripten-core:mainfrom
Conversation
If we open a path that in a / and we're about to create a file, instead return EISDIR.
|
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.