From: Gerd Hoffmann Date: Wed, 2 Jul 2014 10:56:42 +0000 (+0200) Subject: spice: auth fixes X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~706^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b1ea7b79e1675355ea7abe2548ad71dcf7d64b60;p=sdk%2Femulator%2Fqemu.git spice: auth fixes 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 --- 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);