-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
module: node aborts when package.json is a directory #8307
Comments
I vote we not support loading package.json as a directory |
This was never supported (and never worked) but the BSDs are different from other platforms in that trying to open a directory with the open(2) system call is not an error. That is, you can't check for an EISDIR error because you won't get one on the BSDs.
What in particular are you referring to? |
More or less the same implementation as #8277, with null checks for the required file name. To be honest, it's been a long time and I don't remember all the details. |
Regardless of being supported it probably shouldn't cause a hard crash. |
PR up, just added a stat instead of trying to juggle things after open. |
PR-URL: #18270 Fixes: #8307 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: #18270 Fixes: #8307 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: #18270 Fixes: #8307 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: nodejs#18270 Fixes: nodejs#8307 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: nodejs#18270 Fixes: nodejs#8307 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: nodejs#18270 Fixes: nodejs#8307 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
See discussion in #8277.
Caused by the
CHECK_GE(numchars, 0)
inInternalModuleReadFile()
in src/node_file.cc.EDIT: It's worth mentioning that the BSDs allow reading from a directory file descriptor so merely squelching the EISDIR error is probably not the best fix.
The text was updated successfully, but these errors were encountered: