3e5111
From 8c9296cbe21657aadbc4bff88eabd617168349f6 Mon Sep 17 00:00:00 2001
3e5111
Message-Id: <8c9296cbe21657aadbc4bff88eabd617168349f6@dist-git>
3e5111
From: Peter Krempa <pkrempa@redhat.com>
3e5111
Date: Fri, 2 Jun 2017 15:07:59 +0200
3e5111
Subject: [PATCH] daemon: Don't initialize SASL context if not necessary
3e5111
3e5111
SASL context would be initialized even if the corresponding TCP or TLS
3e5111
sockets are not enabled.
3e5111
3e5111
fe772f24a68 attempted to fix the symptom by commenting out the settings,
3e5111
but that did not fix the root cause. 3c647ee4bbb later reverted those
3e5111
changes so that the more secure algorithm is used.
3e5111
3e5111
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1450095
3e5111
(cherry picked from commit ed914284ba74afb7dd16dcb623073bb1a1d5cd21)
3e5111
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
---
3e5111
 daemon/libvirtd.c | 6 +++---
3e5111
 1 file changed, 3 insertions(+), 3 deletions(-)
3e5111
3e5111
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
3e5111
index 891238bcbe..bac4bc1b65 100644
3e5111
--- a/daemon/libvirtd.c
3e5111
+++ b/daemon/libvirtd.c
3e5111
@@ -613,11 +613,11 @@ daemonSetupNetworking(virNetServerPtr srv,
3e5111
 
3e5111
 #if WITH_SASL
3e5111
     if (config->auth_unix_rw == REMOTE_AUTH_SASL ||
3e5111
-        config->auth_unix_ro == REMOTE_AUTH_SASL ||
3e5111
+        (sock_path_ro && config->auth_unix_ro == REMOTE_AUTH_SASL) ||
3e5111
 # if WITH_GNUTLS
3e5111
-        config->auth_tls == REMOTE_AUTH_SASL ||
3e5111
+        (ipsock && config->listen_tls && config->auth_tls == REMOTE_AUTH_SASL) ||
3e5111
 # endif
3e5111
-        config->auth_tcp == REMOTE_AUTH_SASL) {
3e5111
+        (ipsock && config->listen_tcp && config->auth_tcp == REMOTE_AUTH_SASL)) {
3e5111
         saslCtxt = virNetSASLContextNewServer(
3e5111
             (const char *const*)config->sasl_allowed_username_list);
3e5111
         if (!saslCtxt)
3e5111
-- 
3e5111
2.13.1
3e5111