From patchwork Sun Mar 27 14:48:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 88509 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E4CC6B6F87 for ; Mon, 28 Mar 2011 01:47:49 +1100 (EST) Received: from localhost ([127.0.0.1]:59362 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q3rDW-00010w-Vo for incoming@patchwork.ozlabs.org; Sun, 27 Mar 2011 10:45:22 -0400 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 Received: from shalem.localdomain.com (vpn1-6-245.ams2.redhat.com [10.36.6.245]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p2REima3026554; Sun, 27 Mar 2011 10:44:49 -0400 From: Hans de Goede To: qemu-devel@nongnu.org Date: Sun, 27 Mar 2011 16:48:01 +0200 Message-Id: <1301237281-3393-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Hans de Goede Subject: [Qemu-devel] [PATCH] spice: add option for disabling copy paste support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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) {