diff mbox

Fix VNC SASL authentication when using a QXL device

Message ID 1381938753-28761-1-git-send-email-cfergeau@redhat.com
State New
Headers show

Commit Message

Christophe Fergeau Oct. 16, 2013, 3:52 p.m. UTC
ui/vnc.c:vnc_display_open() and spice-server/server/reds.c:do_spice_init()
are both calling sasl_server_init(). If spice_server_set_sasl_appname()
hasn't been called, spice-server will call it with "spice" as an appname,
causing cyrus-sasl to try to use a /etc/sasl2/spice.conf config file rather
than the /etc/sasl2/qemu.conf file that QEMU uses.

When using -spice sasl on the command line, QEMU properly calls
spice_server_set_sasl_appname() to set the SASL appname as "qemu",
but when using a QXL device without using SPICE, spice_server_init()
is called from qemu_spice_add_interface() without setting the appname
to "qemu", which then causes the VNC code to try to use spice.conf
instead of qemu.conf.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
---
 ui/spice-core.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Gerd Hoffmann Oct. 17, 2013, 9:28 a.m. UTC | #1
On Mi, 2013-10-16 at 17:52 +0200, Christophe Fergeau wrote:
> ui/vnc.c:vnc_display_open() and spice-server/server/reds.c:do_spice_init()
> are both calling sasl_server_init(). If spice_server_set_sasl_appname()
> hasn't been called, spice-server will call it with "spice" as an appname,
> causing cyrus-sasl to try to use a /etc/sasl2/spice.conf config file rather
> than the /etc/sasl2/qemu.conf file that QEMU uses.
> 
> When using -spice sasl on the command line, QEMU properly calls
> spice_server_set_sasl_appname() to set the SASL appname as "qemu",
> but when using a QXL device without using SPICE, spice_server_init()
> is called from qemu_spice_add_interface() without setting the appname
> to "qemu", which then causes the VNC code to try to use spice.conf
> instead of qemu.conf.

patch added to spice patch queue.

thanks,
  Gerd
diff mbox

Patch

diff --git a/ui/spice-core.c b/ui/spice-core.c
index 33ef837..d7566b0 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -833,6 +833,7 @@  int qemu_spice_add_interface(SpiceBaseInstance *sin)
          * With a command line like '-vnc :0 -vga qxl' you'll end up here.
          */
         spice_server = spice_server_new();
+        spice_server_set_sasl_appname(spice_server, "qemu");
         spice_server_init(spice_server, &core_interface);
         qemu_add_vm_change_state_handler(vm_change_state_handler, NULL);
     }