User cannot drag-and-drop files from a client to a guest(windows) that already exist on guest.
Steps to Reproduce:
1. Have a some file on guest's Desktop.
2. On client create a file with same name.
3. Drag-and-drop file from client to guest.
Actual results: The file is not copied.
File should be copied. File name on guest should be changed and have a suffix.
This is how it is done for RHEL guest:
file.txt -> file.txt(1) -> file.txt(2) -> file.txt(3)
My point that drag-and-dprop sould work in the unified way for both: Linux & Windows guests.
*** Bug 1440129 has been marked as a duplicate of this bug. ***
Should be fixed by:
Author: Frediano Ziglio <firstname.lastname@example.org>
Date: Wed Apr 26 15:34:53 2017 -0500
Support file transfer for existing files
Previously, if the user attempted to transfer a file that had the same
name as a file that already exists on the guest, we would just fail the
transfer. This patch tries to match the behavior of the linux vdagent
where we try to append an integer onto the name of the new file to make
it unique. For example, if you tried to transfer 'file.doc' to the guest
and that file already existed, it would try to create 'file (1).doc'
instead. If that also failed, it would attempt 'file (2).doc', etc, up
Acked-by: Jonathon Jongsma <email@example.com>
Should be already fixed in latest build since 4.1.z
As per comment #2, we can move this to ON_QA to verify the fix on 4.2
This is not fixed for Windows guests. https://bugzilla.redhat.com/show_bug.cgi?id=1410181#c2 mentions fix for linux guest.
Tried rhel75 host/client + Win10 guest with vdagent-win-4.1-5 drivers installed. After file transfer (of the file, which already exists on guest's desktop) an error message emerges: 'An error caused the following file transfer to fail: $filename'
So moving back..
I've just confirmed that the problem here is not in vdagent's code but in sprintf_s() function or in mingw  to be precise.
The upstream code originaly used sprintf() function as the target buffer has enough space but that seem to cause a crash depending on which Fedora version you were building it with 
The issue around sprintf() was not tracked and I couldn't find any reference to a bug upstream. I've tested here with sprintf() and I could not see any issue.
I'll have a downstream patch changing from sprintf_s() to sprintf() and check how to get the fix for mingw in RHEL/RHEVM.
Just for completeness, running:
> char buffer = "";
> int value = sprintf_s(buffer, 128, "test");
> vd_printf("%d: '%s'\n", value, buffer);
Is going to print "0: ''" instead of "4: 'test'"
(In reply to Victor Toso from comment #6)
> I've just confirmed that the problem here is not in vdagent's code but in
> sprintf_s() function or in mingw  to be precise.
>  https://sourceforge.net/p/mingw-w64/bugs/525/
> The upstream code originaly used sprintf() function as the target buffer has
> enough space but that seem to cause a crash depending on which Fedora
> version you were building it with 
>  https://lists.freedesktop.org/archives/spice-devel/2017-May/037661.html
> The issue around sprintf() was not tracked and I couldn't find any reference
> to a bug upstream. I've tested here with sprintf() and I could not see any
> I'll have a downstream patch changing from sprintf_s() to sprintf() and
> check how to get the fix for mingw in RHEL/RHEVM.
It seems the last builds of mingw-crt were done by us (SPICE team, by Fidencio). If I followed the discussion correctly, the patch fixing sprintf_s is https://github.com/mirror/mingw-w64/commit/9975303 and seems easy to backport (though maybe we'll want to rebase mingw-crt instead while at it?)
Considering comment #8, moving to 4.3.
Should be fixed by rebase on Bug 1615874
I'll move to POST, this should be included in an errata to have the fix documented for customers.
This bug has not been marked as blocker for oVirt 4.3.0.
Since we are releasing it tomorrow, January 29th, this bug has been re-targeted to 4.3.1.
4.3.1 has been released, please re-target this bug as soon as possible.
4.3.1 has been release a while ago as RHV 4.3 Beta 2, re-targeting to 4.3.3 for re-evaluation
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.