summaryrefslogtreecommitdiff
path: root/ui/spice-core.c
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2016-01-12 15:08:58 +0100
committerGerd Hoffmann <kraxel@redhat.com>2016-01-18 16:36:21 +0100
commit06bb88145cb977fe699a80df82b619eadbc29b28 (patch)
tree5975fa40fc5674e9c20102e411513d3a57a04463 /ui/spice-core.c
parent67c4c2bd958b0074ffbcde12cb434cd064adab12 (diff)
downloadqemu-06bb88145cb977fe699a80df82b619eadbc29b28.tar.gz
Fix corner-case when using VNC+SASL+SPICE
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 <cfergeau@redhat.com> Message-id: 1452607738-1521-1-git-send-email-cfergeau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/spice-core.c')
-rw-r--r--ui/spice-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 6a62d712fe..8f27768819 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);