From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlbEc-0005kr-6i for qemu-devel@nongnu.org; Mon, 12 Oct 2015 07:25:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlbEV-0006SA-VX for qemu-devel@nongnu.org; Mon, 12 Oct 2015 07:25:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49967) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlbEV-0006Rz-IA for qemu-devel@nongnu.org; Mon, 12 Oct 2015 07:25:35 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 9B4253CB28E for ; Mon, 12 Oct 2015 11:25:34 +0000 (UTC) From: Christophe Fergeau Date: Mon, 12 Oct 2015 13:25:26 +0200 Message-Id: <1444649126-13863-1-git-send-email-cfergeau@redhat.com> Subject: [Qemu-devel] [PATCH v3] spice: Allow to set password even if disable-ticketing was used List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Before commit b1ea7b79e1, it was possible to start with -spice disable-ticketing, and then use the "set_password spice" command to enable ticketing with SPICE. Since commit b1ea7b79e1 this is no longer possible as qemu_spice_set_ticket() will return an error unless the 'auth' type is "spice". When ticketing is disabled, 'auth' is "none" so the attempt to set password fails. This change of behaviour caused a bug in oVirt https://gerrit.ovirt.org/#/c/44842/ This commit allows to call qemu_spice_set_ticket() when 'auth' is "none" and changes 'auth' to "spice" when this happens. Signed-off-by: Christophe Fergeau Reviewed-by: Daniel P. Berrange --- Changes since v2: - Added mention of the oVirt bug which was caused by the change of behaviour ui/spice-core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/spice-core.c b/ui/spice-core.c index 4da3042..3b20c6c 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -882,6 +882,10 @@ static int qemu_spice_set_ticket(bool fail_if_conn, bool disconnect_if_conn) int qemu_spice_set_passwd(const char *passwd, bool fail_if_conn, bool disconnect_if_conn) { + if (strcmp(auth, "none") == 0) { + /* Allow to set a password when started with 'disable-ticketing' */ + auth = "spice"; + } if (strcmp(auth, "spice") != 0) { return -1; } -- 2.5.0