From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIzdw-00020F-52 for qemu-devel@nongnu.org; Tue, 12 Jan 2016 09:09:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIzds-0002AZ-6S for qemu-devel@nongnu.org; Tue, 12 Jan 2016 09:09:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38538) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIzds-0002AI-10 for qemu-devel@nongnu.org; Tue, 12 Jan 2016 09:09:48 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 3D37412048A for ; Tue, 12 Jan 2016 14:09:47 +0000 (UTC) From: Christophe Fergeau Date: Tue, 12 Jan 2016 15:08:58 +0100 Message-Id: <1452607738-1521-1-git-send-email-cfergeau@redhat.com> Subject: [Qemu-devel] [PATCH] Fix corner-case when using VNC+SASL+SPICE List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Similarly to the commit 764eb39d1b6 fixing VNC+SASL+QXL, when starting QEMU with SPICE but no SASL, and at the same time VNC with SASL, then spice_server_init() will get called without a previous call to spice_server_set_sasl_appname(), which will cause cyrus-sasl to try to use /etc/sasl2/spice.conf (spice-server uses "spice" as its default appname) rather than the expected /etc/sasl2/qemu.conf. This commit unconditionnally calls spice_server_set_sasl_appname() before calling spice_server_init() in order to use the correct appname even if SPICE without SASL was requested on qemu command line. Signed-off-by: Christophe Fergeau --- ui/spice-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/spice-core.c b/ui/spice-core.c index 3322bf2..77b209f 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -743,8 +743,7 @@ void qemu_spice_init(void) qemu_spice_set_passwd(password, false, false); } if (qemu_opt_get_bool(opts, "sasl", 0)) { - if (spice_server_set_sasl_appname(spice_server, "qemu") == -1 || - spice_server_set_sasl(spice_server, 1) == -1) { + if (spice_server_set_sasl(spice_server, 1) == -1) { error_report("spice: failed to enable sasl"); exit(1); } @@ -810,6 +809,7 @@ void qemu_spice_init(void) seamless_migration = qemu_opt_get_bool(opts, "seamless-migration", 0); spice_server_set_seamless_migration(spice_server, seamless_migration); + spice_server_set_sasl_appname(spice_server, "qemu"); if (spice_server_init(spice_server, &core_interface) != 0) { error_report("failed to initialize spice server"); exit(1); -- 2.5.0