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
rmSync does not throw error if file exists but cannot be deleted. #38683
Platform: Darwin Randalls-iMac.fios-router.home 20.4.0 Darwin Kernel Version 20.4.0: Thu Apr 22 21:46:47 PDT 2021; root:xnu-7195.101.2~1/RELEASE_X86_64 x86_64 (macOS 11.3.1)
Subsystem: filesystem
What steps will reproduce the bug?
fs.rmSync does not error if file exists, but cannot be deleted because parent directory is readonly. The file remains, but no error is thrown. (Note that fs.rm works as expected.)
I expect the following code to emit an EACCES error, but it does not:
The commands mkdir tmp ; touch tmp/file ; chmod 500 tmp ; rm -f tmp/file show the expected result rm: tmp/file: Permission denied and the file is not deleted.
I believe Linux systems also exhibit this, but have not explicitly tested this minimal reproducible example on Linux.
@babatakao I understand fixing this caused so many unexpected failures revealed so many uses that needed to catch errors in their CI environment that fixing this is considered a breaking change.
Activity
Linkgoron commentedon May 13, 2021
I think I've found the issue, I'll take a look
babatakao commentedon Dec 20, 2021
Hi, thank you for the fix. Any plan to backport to 16.x LTS?
rhwood commentedon Dec 20, 2021
@babatakao I understand fixing this
caused so many unexpected failuresrevealed so many uses that needed to catch errors in their CI environment that fixing this is considered a breaking change.Linkgoron commentedon Dec 20, 2021
Fixing this issue kind of broke Node.js's build, so we assumed that others would probably face similar issues.
babatakao commentedon Dec 20, 2021
I understand. Thanks!
fs: fix rmsync error swallowing
fix(fs): readSync validates fd, rm's force only swallows ENOENT, stat…