render / rpms / libvirt

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