qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: qemu-devel@nongnu.org
Cc: Hans de Goede <hdegoede@redhat.com>
Subject: [Qemu-devel] [PATCH] spice: add option for disabling copy paste support
Date: Sun, 27 Mar 2011 16:48:01 +0200	[thread overview]
Message-ID: <1301237281-3393-1-git-send-email-hdegoede@redhat.com> (raw)

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

diff --git a/qemu-config.c b/qemu-config.c
index 323d3c2..661c8a8 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -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,
         },{
diff --git a/qemu-options.hx b/qemu-options.hx
index ef60730..1a38311 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -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.
 
diff --git a/ui/spice-core.c b/ui/spice-core.c
index ef56ed6..a21fabc 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -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) {
-- 
1.7.4.1

                 reply	other threads:[~2011-03-27 14:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1301237281-3393-1-git-send-email-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).