Repository navigation
Commit e2396c6
committed
fs: use libuv for recursive cpSync to avoid VirtioFS EACCES
fs.cpSync() recursive copy fails EACCES on Docker VirtioFS bind
mounts. CopyDirRecursive()'s regular-file branch calls
std::filesystem::copy_file(), which libstdc++ implements by creating
dest with mode 0200 and then fchmod(). VirtioFS rejects that initial
0200 open with EACCES. The single-file cpSync path and the
fresh-destination branch of CopyDirRecursive() already avoid this by
using uv_fs_copyfile(), which opens dest with its final mode
directly.
Use uv_fs_copyfile() for the merge-into-existing-directory case too,
preserving force, errorOnExist and skip-existing semantics via
UV_FS_COPYFILE_EXCL and an existence check. Also drops the
file_copy_opts capture, now unused once the regular-file branch no
longer calls std::filesystem::copy_file().
Fixes: #65497
Signed-off-by: Jeremy Schoemaker <jeremy@shoemoney.com>1 parent 9afe7dc commit e2396c6
1 file changed
Lines changed: 33 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4827 | 4827 | | |
4828 | 4828 | | |
4829 | 4829 | | |
4830 | | - | |
4831 | | - | |
4832 | | - | |
4833 | | - | |
4834 | | - | |
4835 | | - | |
4836 | | - | |
4837 | | - | |
4838 | | - | |
4839 | 4830 | | |
4840 | 4831 | | |
4841 | | - | |
| 4832 | + | |
4842 | 4833 | | |
4843 | 4834 | | |
4844 | 4835 | | |
| |||
4989 | 4980 | | |
4990 | 4981 | | |
4991 | 4982 | | |
| 4983 | + | |
| 4984 | + | |
| 4985 | + | |
4992 | 4986 | | |
4993 | | - | |
4994 | | - | |
| 4987 | + | |
| 4988 | + | |
| 4989 | + | |
| 4990 | + | |
| 4991 | + | |
| 4992 | + | |
| 4993 | + | |
| 4994 | + | |
| 4995 | + | |
| 4996 | + | |
| 4997 | + | |
| 4998 | + | |
| 4999 | + | |
| 5000 | + | |
| 5001 | + | |
| 5002 | + | |
| 5003 | + | |
| 5004 | + | |
| 5005 | + | |
| 5006 | + | |
| 5007 | + | |
| 5008 | + | |
| 5009 | + | |
| 5010 | + | |
| 5011 | + | |
| 5012 | + | |
| 5013 | + | |
| 5014 | + | |
| 5015 | + | |
4995 | 5016 | | |
4996 | 5017 | | |
4997 | | - | |
4998 | | - | |
4999 | | - | |
5000 | | - | |
5001 | | - | |
5002 | | - | |
5003 | | - | |
5004 | | - | |
5005 | | - | |
5006 | 5018 | | |
5007 | 5019 | | |
5008 | 5020 | | |
| |||
0 commit comments