From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52412 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q3rD6-0000wT-UU for qemu-devel@nongnu.org; Sun, 27 Mar 2011 10:44:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q3rD2-0004Af-8b for qemu-devel@nongnu.org; Sun, 27 Mar 2011 10:44:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39185) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q3rD1-0004AY-VI for qemu-devel@nongnu.org; Sun, 27 Mar 2011 10:44:52 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2REio99024389 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 27 Mar 2011 10:44:50 -0400 From: Hans de Goede Date: Sun, 27 Mar 2011 16:48:01 +0200 Message-Id: <1301237281-3393-1-git-send-email-hdegoede@redhat.com> Subject: [Qemu-devel] [PATCH] spice: add option for disabling copy paste support List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hans de Goede 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= 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