Uh oh!
There was an error while loading. Please reload this page.
fs: fix readdir and opendir recursive with unknown file types - #49603
Conversation
If the libuv operations invoked by `readdir`/`opendir` return `uv_dirent_t` values where the `type` is `UV_DIRENT_UNKNOWN` then a further `lstat` is issued to fully construct the `Dirent` values. In the recursive versions of these functions, the `path` parameter was incorrectly assumed to be the path to the entry when it should be the path to the directory containing the entry. Fixes#49499.
nodejs-github-bot
commented
Sep 11, 2023
anonrig
commented
Sep 11, 2023
Ethan-Arrowood
commented
Sep 11, 2023
Great investigation and fix @lux01 . Thank you very much! |
MoLow
commented
Sep 11, 2023
@ruyadorno this seems like a serious bug and is ready for landing, perhaps it is a good idea to land this into v18? |
Fast-track has been requested by @MoLow. Please 👍 to approve. |
lux01
commented
Sep 11, 2023
To fix this on the |
nodejs-github-bot
commented
Sep 11, 2023
Landed in d8b378c |
ruyadorno
commented
Sep 12, 2023
@MoLow it hasn't landed on time yet for the v20 release and I prefer not to rush it to v18 before it's out in a current release line. 😊 thanks for the heads up though! |
If the libuv operations invoked by `readdir`/`opendir` return `uv_dirent_t` values where the `type` is `UV_DIRENT_UNKNOWN` then a further `lstat` is issued to fully construct the `Dirent` values. In the recursive versions of these functions, the `path` parameter was incorrectly assumed to be the path to the entry when it should be the path to the directory containing the entry. Fixes#49499. PR-URL: #49603 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
aduh95
commented
Dec 3, 2023
This introduced a breaking change for |
An error occurred in the test/sequential/test-fs-opendir-recursive.js file after changing the code. This was resolved by referring to the code resolved in PR nodejs#49603. Refs: nodejs#49603
If the libuv operations invoked by
readdir/opendirreturnuv_dirent_tvalues where thetypeisUV_DIRENT_UNKNOWNthen a furtherlstatis issued to fully construct theDirentvalues. In the recursive versions of these functions, thepathparameter was incorrectly assumed to be the path to the entry when it should be the path to the directory containing the entry.Fixes#49499.