-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: nodejs#18270 Fixes: nodejs#8307 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
PR-URL: nodejs#18270 Fixes: nodejs#8307 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
PR-URL: nodejs#18270 Fixes: nodejs#8307 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
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: