From patchwork Mon Jan 18 15:53:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 8055701 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 21A3D9F818 for ; Mon, 18 Jan 2016 15:55:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8857E2049C for ; Mon, 18 Jan 2016 15:55:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D92D120497 for ; Mon, 18 Jan 2016 15:55:39 +0000 (UTC) Received: from localhost ([::1]:60426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLC9b-0007Vi-BE for patchwork-qemu-devel@patchwork.kernel.org; Mon, 18 Jan 2016 10:55:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLC7r-0004a1-LQ for qemu-devel@nongnu.org; Mon, 18 Jan 2016 10:53:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLC7o-0002Ms-EV for qemu-devel@nongnu.org; Mon, 18 Jan 2016 10:53:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLC7o-0002Mf-9K for qemu-devel@nongnu.org; Mon, 18 Jan 2016 10:53: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 C3733C076618 for ; Mon, 18 Jan 2016 15:53:47 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-31.ams2.redhat.com [10.36.116.31]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0IFrk2S016939; Mon, 18 Jan 2016 10:53:47 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id C0815801EB; Mon, 18 Jan 2016 16:53:45 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 18 Jan 2016 16:53:43 +0100 Message-Id: <1453132424-15520-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1453132424-15520-1-git-send-email-kraxel@redhat.com> References: <1453132424-15520-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann , Christophe Fergeau Subject: [Qemu-devel] [PULL 3/4] Fix corner-case when 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Christophe Fergeau 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 unconditionally 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 Message-id: 1452607738-1521-1-git-send-email-cfergeau@redhat.com Signed-off-by: Gerd Hoffmann --- 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 6a62d71..8f27768 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -727,8 +727,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); } @@ -794,6 +793,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);