From patchwork Thu Jan 9 09:33:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Fergeau X-Patchwork-Id: 308532 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 34EE52C00B3 for ; Thu, 9 Jan 2014 20:34:14 +1100 (EST) Received: from localhost ([::1]:50894 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1C0B-00044L-UV for incoming@patchwork.ozlabs.org; Thu, 09 Jan 2014 04:34:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1Bzq-00042H-GO for qemu-devel@nongnu.org; Thu, 09 Jan 2014 04:33:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W1Bzk-0005aQ-Hm for qemu-devel@nongnu.org; Thu, 09 Jan 2014 04:33:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:9095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1Bzk-0005aB-Aa for qemu-devel@nongnu.org; Thu, 09 Jan 2014 04:33:44 -0500 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 s099Xhpx027531 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 9 Jan 2014 04:33:43 -0500 Received: from teriyaki.localdomain (teriyaki.cdg.redhat.com [10.32.192.15]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s099XfHN028905 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 9 Jan 2014 04:33:42 -0500 Received: by teriyaki.localdomain (Postfix, from userid 500) id 6312A1AA2CC; Thu, 9 Jan 2014 10:33:41 +0100 (CET) From: Christophe Fergeau To: qemu-devel@nongnu.org Date: Thu, 9 Jan 2014 10:33:38 +0100 Message-Id: <1389260018-29356-1-git-send-email-cfergeau@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH RESEND] Fix another corner-case of using VNC+SASL+SPICE 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 Similarly to the previous commit fixing VNC+SASL+QXL, when starting QEMU with SPICE but no SASL, and also 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. --- 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 4cce3b3..e7b2b71 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -725,8 +725,7 @@ void qemu_spice_init(void) spice_server_set_ticket(spice_server, password, 0, 0, 0); } 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); } @@ -791,6 +790,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 (0 != spice_server_init(spice_server, &core_interface)) { error_report("failed to initialize spice server"); exit(1);