virtio-win / kvm-guest-drivers-windows

Windows paravirtualized drivers for QEMU\KVM
https://www.linux-kvm.org/page/WindowsGuestDrivers
BSD 3-Clause "New" or "Revised" License
1.98k stars 382 forks source link

`ff` escapes in filename when copying over an existing file #763

Closed savchenko closed 11 months ago

savchenko commented 2 years ago

Describe the bug

Copying a file from W10 guest to Linux host, over one with an existing filename, leads to a new file with ff escapes in its name.

ls -al
total 52
drwxr-xr-x 2 user user  4096 Apr 21 01:53  .
drwxr-xr-x 5 user user  4096 Apr 21 01:42  ..
-rw-rw-r-- 1 user user  4077 Apr 21  2022 ''$'\377\377\377\377\377\377\377\377'
-rw-rw-r-- 1 user user 34991 Apr 21 01:42  cmd.bat
-rw-rw-r-- 1 user user  4080 Apr 21  2022  powershell.ps1

To Reproduce

Copy file with an existing filename the mounted share

Expected behavior

Warning that such file exists.

Screenshots

image

Host:

VM:

Additional context

VShare configuration:

<filesystem type="mount" accessmode="passthrough">
  <driver type="virtiofs" queue="1024"/>
  <binary path="/usr/lib/qemu/virtiofsd"/>
  <source dir="/tmp/vshare"/>
  <target dir="vshare"/>
  <alias name="fs0"/>
  <address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0"/>
</filesystem>
viktor-prutyanov commented 2 years ago

Hi @savchenko ,

could you please write detailed steps to reproduce the issue?

As for me, overwrite works:

C:\Users\Administrator>echo Hello > Z:\hello.txt

C:\Users\Administrator>echo Hello > hello.txt

C:\Users\Administrator>copy hello.txt Z:\hello.txt
Overwrite Z:\hello.txt? (Yes/No/All): y
        1 file(s) copied.

C:\Users\Administrator>Z:

Z:\>dir
 Volume in drive Z is mount_tag
 Volume Serial Number is 0000-0000

 Directory of Z:\

12/31/1969  05:00 PM    <DIR>          .
12/31/1969  05:00 PM    <DIR>          ..
04/22/2022  04:38 AM                 8 hello.txt
               1 File(s)              8 bytes
               2 Dir(s)  97,393,795,072 bytes free