You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fs.mkdir/mkdirSync hang with {recursive: true} if name is invalid #28599
Those are all invalid characters on NTFS, see here.
Not sure if Node.js should do validation for those (and take a performance hit on every platform). There are modules like this which you can use to validate yourself.
The hang itself should probably be investigated, thought.
Yes - I know this module. However, it is not cross plattform as far as I can tell - ':', '<', '>','|' may be valid on Linux (although not necessarily recommended, I guess). Yes, of course I could distinguish platforms. But I could as well rely on "fs.mkdir" to fail, if something is wrong.
The point is, Node should, if it fails to create the directory for whatever reason, give a reasonable error and, of course, not hang - with { recursive: true } or not.
This is similar to #27198, which was fixed by #27207.
For invalid filenames, uv_fs_mkdir returns UV_ENOENT, which confuses the fs.mkdir function. It constantly creates the parent directory then tries to create the invalid folder.
Made a libuv PR that makes it return UV_EINVAL for invalid filenames. This fixes this issue.
Activity
Hakerh400 commentedon Jul 8, 2019
Colons on NTFS files systems on Windows denote file streams (source).
jeffrson commentedon Jul 8, 2019
The error is the same for "invalid>", "invalid<" oder "invalid|".
silverwind commentedon Jul 9, 2019
Those are all invalid characters on NTFS, see here.
Not sure if Node.js should do validation for those (and take a performance hit on every platform). There are modules like this which you can use to validate yourself.
The hang itself should probably be investigated, thought.
jeffrson commentedon Jul 10, 2019
Yes - I know this module. However, it is not cross plattform as far as I can tell - ':', '<', '>','|' may be valid on Linux (although not necessarily recommended, I guess). Yes, of course I could distinguish platforms. But I could as well rely on "fs.mkdir" to fail, if something is wrong.
The point is, Node should, if it fails to create the directory for whatever reason, give a reasonable error and, of course, not hang - with { recursive: true } or not.
win, fs: mkdir return UV_EINVAL for invalid names
win, fs: mkdir return UV_EINVAL for invalid names
bzoz commentedon Jul 11, 2019
This is similar to #27198, which was fixed by #27207.
For invalid filenames,
uv_fs_mkdirreturnsUV_ENOENT, which confuses thefs.mkdirfunction. It constantly creates the parent directory then tries to create the invalid folder.Made a libuv PR that makes it return
UV_EINVALfor invalid filenames. This fixes this issue.win, fs: mkdir return UV_EINVAL for invalid names
deps: upgrade to libuv 1.31.0
deps: upgrade to libuv 1.31.0
win, fs: mkdir return UV_EINVAL for invalid names
win, fs: mkdir return UV_EINVAL for invalid names
fix(test): 审计用例在 Linux 上活锁,CI 从来不是变红而是卡死
fix(fs): 递归 mkdir 会在 procfs 上活锁,换成有界实现