Skip to contentSkip to conversation

Fix corner-case when using VNC+SASL+SPICE

PATCH In review Christophe Fergeau 3 participants 5 messages Jan 12, 2016 – Jan 18, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 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(-)
ui/spice-core.c +2 -2
index 3322bf2..77b209f 100644
@@ -743,8 +743,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);
         }
@@ -810,6 +809,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);
Signature · 1 line
2.5.0
#1 lore raw
Quoted 10 lines · 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 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.

Added to patch queue.

thanks,
Gerd

#2 lore raw
In reply to Christophe Fergeau
Quoted 8 lines · 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 unconditionnally calls spice_server_set_sasl_appname()

s/unconditionnally/unconditionally/

Quoted 5 lines

before calling spice_server_init() in order to use the correct appname even if SPICE without SASL was requested on qemu command line.

---

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#3 lore raw
Quoted 3 lines · Eric Blake
Quoted 1 line

This commit unconditionnally calls spice_server_set_sasl_appname()

s/unconditionnally/unconditionally/

Fixed up, no need to resend.

cheers,
Gerd

#4 lore raw
Quoted 6 lines · Gerd Hoffmann
Quoted 3 lines · Eric Blake
Quoted 1 line

This commit unconditionnally calls spice_server_set_sasl_appname()

s/unconditionnally/unconditionally/

Fixed up, no need to resend.

Thanks!

Christophe