From patchwork Fri Aug 14 12:47:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Fergeau X-Patchwork-Id: 507369 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 81E28140216 for ; Fri, 14 Aug 2015 22:47:51 +1000 (AEST) Received: from localhost ([::1]:46074 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQEOj-0007du-Nq for incoming@patchwork.ozlabs.org; Fri, 14 Aug 2015 08:47:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQEOM-0007B8-9m for qemu-devel@nongnu.org; Fri, 14 Aug 2015 08:47:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZQEOH-0002Ju-Ad for qemu-devel@nongnu.org; Fri, 14 Aug 2015 08:47:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59827) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQEOH-0002Jf-55 for qemu-devel@nongnu.org; Fri, 14 Aug 2015 08:47:21 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 05BFB3725A5 for ; Fri, 14 Aug 2015 12:47:20 +0000 (UTC) Received: from edamame.cdg.redhat.com (ovpn-116-80.ams2.redhat.com [10.36.116.80]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7EClIbK013600 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 14 Aug 2015 08:47:19 -0400 Received: by edamame.cdg.redhat.com (Postfix, from userid 1000) id 2FA8814187F; Fri, 14 Aug 2015 14:47:18 +0200 (CEST) From: Christophe Fergeau To: qemu-devel@nongnu.org Date: Fri, 14 Aug 2015 14:47:15 +0200 Message-Id: <1439556435-20541-1-git-send-email-cfergeau@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] spice: Allow to set password even if disable-ticketing was used X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 commit allows to call qemu_spice_set_ticket() when 'auth' is "none" and changes 'auth' to "spice" when this happens. Reviewed-by: Daniel P. Berrange --- 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; }