Skip to contentSkip to conversation

spice: add option for disabling copy paste support

PATCH New Hans de Goede 1 participant 1 message Mar 27, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spice: add option for disabling copy paste support

Some people want to be able disable spice's guest <-> client copy paste support because of security considerations.

---
 qemu-config.c   |    3 +++
 qemu-options.hx |    3 +++
 ui/spice-core.c |    9 +++++++++
 3 files changed, 15 insertions(+), 0 deletions(-)
qemu-config.c +3 -0
index 323d3c2..661c8a8 100644
@@ -386,6 +386,9 @@ QemuOptsList qemu_spice_opts = {
             .name = "disable-ticketing",
             .type = QEMU_OPT_BOOL,
         },{
+            .name = "disable-copy-paste",
+            .type = QEMU_OPT_BOOL,
+        },{
             .name = "x509-dir",
             .type = QEMU_OPT_STRING,
         },{
qemu-options.hx +3 -0
index ef60730..1a38311 100644
@@ -715,6 +715,9 @@ Set the password you need to authenticate.
 @item disable-ticketing
 Allow client connects without authentication.
 
+@item disable-copy-paste
+Disable copy paste between the client and the guest.
+
 @item tls-port=<nr>
 Set the TCP port spice is listening on for encrypted channels.
 
ui/spice-core.c +9 -0
index ef56ed6..a21fabc 100644
@@ -554,6 +554,15 @@ void qemu_spice_init(void)
         spice_server_set_noauth(spice_server);
     }
 
+    if (qemu_opt_get_bool(opts, "disable-copy-paste", 0)) {
+#if SPICE_SERVER_VERSION >= 0x000801
+        spice_server_set_agent_copypaste(spice_server, 0);
+#else
+        fprintf(stderr, "spice: disable-copy-paste is only supported when compiled with spice-server >= 0.8.1\n");
+        exit(1);
+#endif
+    }
+
     compression = SPICE_IMAGE_COMPRESS_AUTO_GLZ;
     str = qemu_opt_get(opts, "image-compression");
     if (str) {
Signature · 1 line
1.7.4.1