From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2ITr-0002iP-6U for qemu-devel@nongnu.org; Wed, 02 Jul 2014 07:13:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2ITj-0005hN-OP for qemu-devel@nongnu.org; Wed, 02 Jul 2014 07:13:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2ITj-0005hA-Gl for qemu-devel@nongnu.org; Wed, 02 Jul 2014 07:13:31 -0400 From: Gerd Hoffmann Date: Wed, 2 Jul 2014 12:59:56 +0200 Message-Id: <1404298796-30635-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH] spice: auth fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Anthony Liguori Set auth to sasl when sasl is enabled, this makes "info spice" correctly display sasl auth. Also throw an error in case someone tries to set a spice password via monitor without auth mode being "spice". Signed-off-by: Gerd Hoffmann --- ui/spice-core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/spice-core.c b/ui/spice-core.c index 70df446..7bb91e6 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -741,6 +741,7 @@ void qemu_spice_init(void) error_report("spice: failed to enable sasl"); exit(1); } + auth = "sasl"; } if (qemu_opt_get_bool(opts, "disable-ticketing", 0)) { auth = "none"; @@ -894,6 +895,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, "spice") != 0) { + return -1; + } + g_free(auth_passwd); auth_passwd = g_strdup(passwd); return qemu_spice_set_ticket(fail_if_conn, disconnect_if_conn); -- 1.8.3.1