Bug 1247535 - [RFE] Spice: support rich text copy & paste
[RFE] Spice: support rich text copy & paste
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: RFEs (Show other bugs)
3.6.0
Unspecified Unspecified
unspecified Severity low
: ---
: ---
Assigned To: Scott Herold
Gil Klein
: FutureFeature
Depends On: 1381906
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-28 05:19 EDT by Andrei Stepanov
Modified: 2016-12-16 03:38 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
: 1256775 (view as bug list)
Environment:
Last Closed: 2016-12-16 03:38:46 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Spice
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Small Windows utility to dump clipboard content (1.74 KB, text/x-csrc)
2015-08-25 08:37 EDT, Frediano Ziglio
no flags Details

  None (edit)
Description Andrei Stepanov 2015-07-28 05:19:52 EDT
Copy text/graphic from guest's FF and paste to client's OOWriter fails.

Vice-versa variant also fails: paste from client's FF to guest's OOWriter failbacks to plain text.

How reproducible: always

Clients:
Fedora21: virt-viewer-2.0-1.fc21.x86_64
RHEL7: virt-viewer-0.6.0-12.el7.x86_64

GuestOS: Fedora22
libreoffice-writer-4.4.3.2-4.fc22.x86_64
firefox-38.0.1-1.fc22.x86_64
spice-vdagent-0.15.0-3.fc22.x86_64

Host: Rhel71
spice-server.x86_64 0:0.12.4-9.el7


Copy/paste of an ordinary image works as expected.


Log for Copy/Paste from guest's FF to client's OOWriter

[astepano@dhcp131-23 ~]$ spice-vdagent -d -x
spice-vdagent[2880]: 0x1a66010 connected to /var/run/spice-vdagentd/spice-vdagent-sock
spice-vdagent[2880]: Selection window: 2097153
spice-vdagent[2880]: Screen 0 1440x900+0+0
spice-vdagent[2880]: 0x1a66010 sent guest xorg resolution, arg1: 1440, arg2: 900, size 16
spice-vdagent[2880]: net_wm_name: "GNOME Shell", has icons: 0
spice-vdagent[2880]: 0x1a66010 received version, arg1: 0, arg2: 0, size 7
spice-vdagent[2880]: 0x1a66010 received client disconnected, arg1: 0, arg2: 0, size 0


spice-vdagent[2880]: primary: New selection owner: 20971867
spice-vdagent[2880]: primary: New selection owner: 20971867
spice-vdagent[2880]: primary: received 7 targets:
spice-vdagent[2880]: primary: TIMESTAMP
spice-vdagent[2880]: primary: TARGETS
spice-vdagent[2880]: primary: MULTIPLE
spice-vdagent[2880]: primary: UTF8_STRING
spice-vdagent[2880]: primary: COMPOUND_TEXT
spice-vdagent[2880]: primary: TEXT
spice-vdagent[2880]: primary: STRING
spice-vdagent[2880]: 0x1a66010 sent clipboard grab, arg1: 1, arg2: 0, size 4
spice-vdagent[2880]: primary: New selection owner: 20971867
spice-vdagent[2880]: 0x1a66010 sent clipboard release, arg1: 1, arg2: 0, size 0
spice-vdagent[2880]: primary: received 11 targets:
spice-vdagent[2880]: primary: TIMESTAMP
spice-vdagent[2880]: primary: TARGETS
spice-vdagent[2880]: primary: MULTIPLE
spice-vdagent[2880]: primary: text/html
spice-vdagent[2880]: primary: text/_moz_htmlcontext
spice-vdagent[2880]: primary: text/_moz_htmlinfo
spice-vdagent[2880]: primary: UTF8_STRING
spice-vdagent[2880]: primary: COMPOUND_TEXT
spice-vdagent[2880]: primary: TEXT
spice-vdagent[2880]: primary: STRING
spice-vdagent[2880]: primary: text/x-moz-url-priv
spice-vdagent[2880]: 0x1a66010 sent clipboard grab, arg1: 1, arg2: 0, size 4
spice-vdagent[2880]: clipboard: New selection owner: 20971867
spice-vdagent[2880]: clipboard: received 12 targets:
spice-vdagent[2880]: clipboard: TIMESTAMP
spice-vdagent[2880]: clipboard: TARGETS
spice-vdagent[2880]: clipboard: MULTIPLE
spice-vdagent[2880]: clipboard: SAVE_TARGETS
spice-vdagent[2880]: clipboard: text/html
spice-vdagent[2880]: clipboard: text/_moz_htmlcontext
spice-vdagent[2880]: clipboard: text/_moz_htmlinfo
spice-vdagent[2880]: clipboard: UTF8_STRING
spice-vdagent[2880]: clipboard: COMPOUND_TEXT
spice-vdagent[2880]: clipboard: TEXT
spice-vdagent[2880]: clipboard: STRING
spice-vdagent[2880]: clipboard: text/x-moz-url-priv
spice-vdagent[2880]: 0x1a66010 sent clipboard grab, arg1: 0, arg2: 0, size 4
spice-vdagent[2880]: clipboard: New selection owner: 20971867
spice-vdagent[2880]: 0x1a66010 sent clipboard release, arg1: 0, arg2: 0, size 0
spice-vdagent[2880]: clipboard: received 12 targets:
spice-vdagent[2880]: clipboard: TIMESTAMP
spice-vdagent[2880]: clipboard: TARGETS
spice-vdagent[2880]: clipboard: MULTIPLE
spice-vdagent[2880]: clipboard: SAVE_TARGETS
spice-vdagent[2880]: clipboard: text/html
spice-vdagent[2880]: clipboard: text/_moz_htmlcontext
spice-vdagent[2880]: clipboard: text/_moz_htmlinfo
spice-vdagent[2880]: clipboard: UTF8_STRING
spice-vdagent[2880]: clipboard: COMPOUND_TEXT
spice-vdagent[2880]: clipboard: TEXT
spice-vdagent[2880]: clipboard: STRING
spice-vdagent[2880]: clipboard: text/x-moz-url-priv
spice-vdagent[2880]: 0x1a66010 sent clipboard grab, arg1: 0, arg2: 0, size 4
spice-vdagent[2880]: 0x1a66010 received clipboard request, arg1: 0, arg2: 1, size 0
spice-vdagent[2880]: 0x1a66010 sent clipboard data, arg1: 0, arg2: 1, size 12237
Comment 2 Frediano Ziglio 2015-07-28 07:49:42 EDT
Our software does not handle formats other than text and images.

I tried to search for some tools to dump data stored on clipboard.
For X xclip is perfect, allows to see all formats of data and retrieve one by one.
For Windows beside "Clipboard Viewer" for Windows XP I didn't find any specific (lot of tools for doing awesome stuff with the clipboard but none for an easy raw dump). So I wrote my own (as was easy too!), I'll attach to this ticket.

Basically two formats are supported for text+images: RTF and HTML (RTF even on Linux by oowriter!).

Linux:
- copying from Firefox produce a piece of html in text/html format with images linked to html page (with URLs to internet), no RTF;
- copying from oowriter (same data after a paste to it) produce RTF and HTML, HTML has embedded images (encoded with base64).

Windows:
- copying from IE produce both HTML and RTF. RTF does not contain images. HTML format is different as it has an header (search "html format clipboard msdn" on Google, for instance I got https://msdn.microsoft.com/en-us/library/windows/desktop/ms649015%28v=vs.85%29.aspx for format) and HTML start from start of page till the copied data.
Comment 6 Frediano Ziglio 2015-07-28 09:43:54 EDT
Security note for implementation: HTML can contain URLs which could force the guest that receive data to fetch these URLs. Consider for instance what happen for local URLs. Could images be included in the output? Could code (JavaScript) be executed in destination guest? Malicious guest could insert links in the clipboard invisible but that help track other guest (information like IP address for instance).
Comment 7 Frediano Ziglio 2015-08-25 08:36:01 EDT
Opened https://bugzilla.redhat.com/show_bug.cgi?id=1256775 to track same issue on Fedora.
Comment 8 Frediano Ziglio 2015-08-25 08:37:14 EDT
Created attachment 1066835 [details]
Small Windows utility to dump clipboard content

I compile it with a simple Makefile as

CC := i686-w64-mingw32-gcc
CFLAGS := -s -O2 -Wall

dumpclip.exe: dumpclip.c Makefile
	$(CC) $(CFLAGS) -o $@ $<
Comment 9 Martin Tessun 2016-12-16 03:38:46 EST
Same as for BZ 1381906. (See https://bugzilla.redhat.com/show_bug.cgi?id=1381906#c3)

As such closing as WONTFIX as well.
Please reopen with a business justification, if this is really needed.

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