-
Notifications
You must be signed in to change notification settings - Fork 30k
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
[fs.cp] fails with EPERM despite filter #44720
Comments
I assume it is because |
@tniessen am I right if we should add this check before calling checkPathsSync()?
And since the startCopy has 2 lines and one of them is the filter call, should we move its main logic to copyDir and remove this function? Overall, the copyDir will look like this:
|
fix: nodejs#44720 issue: - [copyDir](https://github.com/nodejs/node/blob/7e0097d8a33fa7adbc1f298cbf647f6d2fd403e8/lib/internal/fs/cp/cp-sync.js#L287-L289) calls checkPathsSync(), which invokes lstat() which causes error because not checking the opts.filter changes: - check opts.filter before calling `checkPathsSync` and invoking copy logic - cleanup `startCopy` function
fix: nodejs#44720 issue: - `copyDir()` calls `checkPathsSync()`, which invokes `lstat()` which causes error because of not checking the opts.filter changes: - check opts.filter before calling `checkPathsSync` and copy logic - cleanup `startCopy` function
PR-URL: nodejs#45143 Fixes: nodejs#44720 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Version
v18.9.0
Platform
Microsoft Windows NT 10.0.19044.0 x64
Subsystem
No response
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Happens every time. Both drives are external, connected via USB.
Source can also be a subdirectory, analogous error.
I generally use Powershell Core, not the built-in Powershell.
But the same happens there.
What is the expected behavior?
The copy operation proceeds without trying to access the filtered-out directory.
What do you see instead?
Additional information
This was triggered by jprichardson/node-fs-extra#965 (comment)
The text was updated successfully, but these errors were encountered: