Bug 1410181 - Support drag-n-drop for existing files.
Summary: Support drag-n-drop for existing files.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: spice-vdagent-win
Version: ---
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Victor Toso
QA Contact: SPICE QE bug list
URL:
Whiteboard:
: 1440129 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-04 16:50 UTC by Andrei Stepanov
Modified: 2019-10-10 14:22 UTC (History)
11 users (show)

Fixed In Version: vdagent-win-4.3-1 mingw-spice-vdagent-0.9.0-5
Doc Type: If docs needed, set a value
Doc Text:
In this release, copying a file by drag-and-drop from a client to a Windows guest is now supported even when the copied file name already exists on the Windows guest. The new copy of the file is renamed with a numeral added to the file name.
Clone Of:
Environment:
Last Closed: 2019-06-20 14:46:55 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:1555 0 None None None 2019-06-20 14:46:57 UTC

Description Andrei Stepanov 2017-01-04 16:50:15 UTC
User cannot drag-and-drop files from a client to a guest(windows) that already exist on guest. 

vdagent-win-4.1-1
RHEV-toolsSetup_4.1_3.iso
rhev-guest-tools-iso-4.1-3.el7ev.noarch


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.

Expected results:
File should be copied. File name on guest should be changed and have a suffix.

Additional info:
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.

Comment 1 Andrei Stepanov 2017-04-07 11:34:44 UTC
*** Bug 1440129 has been marked as a duplicate of this bug. ***

Comment 2 Victor Toso 2017-11-30 17:53:23 UTC
Should be fixed by:

commit 241425b7da80626f0d3bc471202e753f0f1dd178
Author: Frediano Ziglio <fziglio@redhat.com>
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
    to 63.
    
    Resolves: rhbz#1410181
    Acked-by: Jonathon Jongsma <jjongsma@redhat.com>

Should be already fixed in latest build since 4.1.z

Comment 3 Victor Toso 2017-12-11 07:59:07 UTC
As per comment #2, we can move this to ON_QA to verify the fix on 4.2

Comment 5 Radek Duda 2018-02-21 09:01:25 UTC
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..

Comment 6 Victor Toso 2018-02-23 11:27:59 UTC
I've just confirmed that the problem here is not in vdagent's code but in sprintf_s() function or in mingw [0] to be precise.

[0] 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 [1]

[1] 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 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[128] = "";
>     int value = sprintf_s(buffer, 128, "test");
>     vd_printf("%d: '%s'\n", value, buffer);

Is going to print "0: ''" instead of "4: 'test'"

Comment 8 Christophe Fergeau 2018-02-23 13:17:58 UTC
(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 [0] to be precise.
> 
> [0] 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 [1]
> 
> [1] 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
> 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.

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?)

Comment 9 Victor Toso 2018-02-26 12:36:25 UTC
Considering comment #8, moving to 4.3.

Comment 11 Victor Toso 2018-10-22 10:56:00 UTC
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.

Comment 12 Sandro Bonazzola 2019-01-28 09:40:19 UTC
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.

Comment 14 Sandro Bonazzola 2019-03-12 12:54:25 UTC
4.3.1 has been released, please re-target this bug as soon as possible.

Comment 15 Sandro Bonazzola 2019-03-26 10:14:43 UTC
4.3.1 has been release a while ago as RHV 4.3 Beta 2, re-targeting to 4.3.3 for re-evaluation

Comment 21 errata-xmlrpc 2019-06-20 14:46:55 UTC
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.

https://access.redhat.com/errata/RHBA-2019:1555


Note You need to log in before you can comment on or make changes to this bug.