[PATCH 6/9] Convert HAVE_SASL to WITH_SASL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 configure.ac                 |  4 ++--
 daemon/Makefile.am           |  2 +-
 daemon/libvirtd-config.c     |  4 ++--
 daemon/libvirtd.c            |  4 ++--
 daemon/libvirtd.h            |  6 +++---
 daemon/remote.c              |  2 +-
 src/Makefile.am              |  4 ++--
 src/remote/remote_driver.c   |  8 ++++----
 src/rpc/virnetclient.c       | 10 +++++-----
 src/rpc/virnetclient.h       |  4 ++--
 src/rpc/virnetserverclient.c | 13 ++++++-------
 src/rpc/virnetserverclient.h |  2 +-
 src/rpc/virnetsocket.c       | 16 ++++++++--------
 src/rpc/virnetsocket.h       |  4 ++--
 tests/libvirtdconftest.c     |  2 +-
 15 files changed, 42 insertions(+), 43 deletions(-)

diff --git a/configure.ac b/configure.ac
index 33abf5a..1a28e98 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1134,11 +1134,11 @@ if test "x$with_sasl" != "xno"; then
   CFLAGS="$old_cflags"
   LIBS="$old_libs"
   if test "x$with_sasl" = "xyes" ; then
-    AC_DEFINE_UNQUOTED([HAVE_SASL], 1,
+    AC_DEFINE_UNQUOTED([WITH_SASL], 1,
       [whether Cyrus SASL is available for authentication])
   fi
 fi
-AM_CONDITIONAL([HAVE_SASL], [test "x$with_sasl" = "xyes"])
+AM_CONDITIONAL([WITH_SASL], [test "x$with_sasl" = "xyes"])
 AC_SUBST([SASL_CFLAGS])
 AC_SUBST([SASL_LIBS])
 
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index c59084c..e14b3c1 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -390,7 +390,7 @@ $(srcdir)/libvirtd.8.in: libvirtd.pod.in
 
 # This is needed for clients too, so can't wrap in
 # the WITH_LIBVIRTD conditional
-if HAVE_SASL
+if WITH_SASL
 install-data-sasl:
 	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sasl2/
 	$(INSTALL_DATA) $(srcdir)/libvirtd.sasl $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
diff --git a/daemon/libvirtd-config.c b/daemon/libvirtd-config.c
index 8b74bf1..fe9fc10 100644
--- a/daemon/libvirtd-config.c
+++ b/daemon/libvirtd-config.c
@@ -178,7 +178,7 @@ static int remoteConfigGetAuth(virConfPtr conf, const char *key, int *auth, cons
 
     if (STREQ(p->str, "none")) {
         *auth = VIR_NET_SERVER_SERVICE_AUTH_NONE;
-#if HAVE_SASL
+#if WITH_SASL
     } else if (STREQ(p->str, "sasl")) {
         *auth = VIR_NET_SERVER_SERVICE_AUTH_SASL;
 #endif
@@ -263,7 +263,7 @@ daemonConfigNew(bool privileged ATTRIBUTE_UNUSED)
         !data->unix_sock_rw_perms)
         goto no_memory;
 
-#if HAVE_SASL
+#if WITH_SASL
     data->auth_tcp = REMOTE_AUTH_SASL;
 #else
     data->auth_tcp = REMOTE_AUTH_NONE;
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index ff54af3..7a51387 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -98,7 +98,7 @@
 
 #include "virdbus.h"
 
-#if HAVE_SASL
+#if WITH_SASL
 virNetSASLContextPtr saslCtxt = NULL;
 #endif
 virNetServerProgramPtr remoteProgram = NULL;
@@ -578,7 +578,7 @@ static int daemonSetupNetworking(virNetServerPtr srv,
 #endif
     }
 
-#if HAVE_SASL
+#if WITH_SASL
     if (config->auth_unix_rw == REMOTE_AUTH_SASL ||
         config->auth_unix_ro == REMOTE_AUTH_SASL ||
 # if HAVE_GNUTLS
diff --git a/daemon/libvirtd.h b/daemon/libvirtd.h
index 69a77ea..6b5ceb7 100644
--- a/daemon/libvirtd.h
+++ b/daemon/libvirtd.h
@@ -35,7 +35,7 @@
 # include "qemu_protocol.h"
 # include "virlog.h"
 # include "virthread.h"
-# if HAVE_SASL
+# if WITH_SASL
 #  include "virnetsaslcontext.h"
 # endif
 # include "virnetserverprogram.h"
@@ -52,7 +52,7 @@ struct daemonClientPrivate {
 
     int domainEventCallbackID[VIR_DOMAIN_EVENT_ID_LAST];
 
-# if HAVE_SASL
+# if WITH_SASL
     virNetSASLSessionPtr sasl;
 # endif
 
@@ -66,7 +66,7 @@ struct daemonClientPrivate {
     bool keepalive_supported;
 };
 
-# if HAVE_SASL
+# if WITH_SASL
 extern virNetSASLContextPtr saslCtxt;
 # endif
 extern virNetServerProgramPtr remoteProgram;
diff --git a/daemon/remote.c b/daemon/remote.c
index 67fe335..1a0af7e 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -2432,7 +2432,7 @@ cleanup:
 }
 
 
-#ifdef HAVE_SASL
+#ifdef WITH_SASL
 /*
  * Initializes the SASL session in prepare for authentication
  * and gives the client a list of allowed mechanisms to choose
diff --git a/src/Makefile.am b/src/Makefile.am
index 87aa2f2..bc288bd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1422,7 +1422,7 @@ if WITH_XENXS
 USED_SYM_FILES += $(srcdir)/libvirt_xenxs.syms
 endif
 
-if HAVE_SASL
+if WITH_SASL
 USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
 endif
 
@@ -1787,7 +1787,7 @@ else
 EXTRA_DIST += \
 	rpc/virnettlscontext.h rpc/virnettlscontext.c
 endif
-if HAVE_SASL
+if WITH_SASL
 libvirt_net_rpc_la_SOURCES += \
 	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
 else
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 43c1186..862e474 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -118,7 +118,7 @@ static int callWithFD(virConnectPtr conn, struct private_data *priv,
                       xdrproc_t ret_filter, char *ret);
 static int remoteAuthenticate(virConnectPtr conn, struct private_data *priv,
                               virConnectAuthPtr auth, const char *authtype);
-#if HAVE_SASL
+#if WITH_SASL
 static int remoteAuthSASL(virConnectPtr conn, struct private_data *priv,
                           virConnectAuthPtr auth, const char *mech);
 #endif
@@ -3489,7 +3489,7 @@ remoteAuthenticate(virConnectPtr conn, struct private_data *priv,
     }
 
     switch (type) {
-#if HAVE_SASL
+#if WITH_SASL
     case REMOTE_AUTH_SASL: {
         const char *mech = NULL;
         if (authtype &&
@@ -3532,7 +3532,7 @@ remoteAuthenticate(virConnectPtr conn, struct private_data *priv,
 
 
 
-#if HAVE_SASL
+#if WITH_SASL
 static int remoteAuthCredVir2SASL(int vircred)
 {
     switch (vircred) {
@@ -4072,7 +4072,7 @@ remoteAuthSASL(virConnectPtr conn, struct private_data *priv,
 
     return ret;
 }
-#endif /* HAVE_SASL */
+#endif /* WITH_SASL */
 
 
 #if HAVE_POLKIT
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index a79b79b..10ed4f0 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -81,7 +81,7 @@ struct _virNetClient {
     /* For incoming message packets */
     virNetMessage msg;
 
-#if HAVE_SASL
+#if WITH_SASL
     virNetSASLSessionPtr sasl;
 #endif
 
@@ -632,7 +632,7 @@ void virNetClientDispose(void *obj)
 #if HAVE_GNUTLS
     virObjectUnref(client->tls);
 #endif
-#if HAVE_SASL
+#if WITH_SASL
     virObjectUnref(client->sasl);
 #endif
 
@@ -671,7 +671,7 @@ virNetClientCloseLocked(virNetClientPtr client)
     virObjectUnref(client->tls);
     client->tls = NULL;
 #endif
-#if HAVE_SASL
+#if WITH_SASL
     virObjectUnref(client->sasl);
     client->sasl = NULL;
 #endif
@@ -739,7 +739,7 @@ void virNetClientClose(virNetClientPtr client)
 }
 
 
-#if HAVE_SASL
+#if WITH_SASL
 void virNetClientSetSASLSession(virNetClientPtr client,
                                 virNetSASLSessionPtr sasl)
 {
@@ -864,7 +864,7 @@ bool virNetClientIsEncrypted(virNetClientPtr client)
     if (client->tls)
         ret = true;
 #endif
-#if HAVE_SASL
+#if WITH_SASL
     if (client->sasl)
         ret = true;
 #endif
diff --git a/src/rpc/virnetclient.h b/src/rpc/virnetclient.h
index d594add..7e35b9c 100644
--- a/src/rpc/virnetclient.h
+++ b/src/rpc/virnetclient.h
@@ -27,7 +27,7 @@
 #  include "virnettlscontext.h"
 # endif
 # include "virnetmessage.h"
-# ifdef HAVE_SASL
+# ifdef WITH_SASL
 #  include "virnetsaslcontext.h"
 # endif
 # include "virnetclientprogram.h"
@@ -104,7 +104,7 @@ int virNetClientSendWithReplyStream(virNetClientPtr client,
                                     virNetMessagePtr msg,
                                     virNetClientStreamPtr st);
 
-# ifdef HAVE_SASL
+# ifdef WITH_SASL
 void virNetClientSetSASLSession(virNetClientPtr client,
                                 virNetSASLSessionPtr sasl);
 # endif
diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
index bf23d24..05e0e06 100644
--- a/src/rpc/virnetserverclient.c
+++ b/src/rpc/virnetserverclient.c
@@ -23,7 +23,7 @@
 
 #include <config.h>
 
-#if HAVE_SASL
+#if WITH_SASL
 # include <sasl/sasl.h>
 #endif
 
@@ -70,7 +70,7 @@ struct _virNetServerClient
     virNetTLSContextPtr tlsCtxt;
     virNetTLSSessionPtr tls;
 #endif
-#if HAVE_SASL
+#if WITH_SASL
     virNetSASLSessionPtr sasl;
 #endif
     int sockTimer; /* Timer to be fired upon cached data,
@@ -652,7 +652,7 @@ bool virNetServerClientIsSecure(virNetServerClientPtr client)
     if (client->tls)
         secure = true;
 #endif
-#if HAVE_SASL
+#if WITH_SASL
     if (client->sasl)
         secure = true;
 #endif
@@ -663,8 +663,7 @@ bool virNetServerClientIsSecure(virNetServerClientPtr client)
 }
 
 
-
-#if HAVE_SASL
+#if WITH_SASL
 void virNetServerClientSetSASLSession(virNetServerClientPtr client,
                                       virNetSASLSessionPtr sasl)
 {
@@ -761,7 +760,7 @@ void virNetServerClientDispose(void *obj)
         client->privateDataFreeFunc(client->privateData);
 
     VIR_FREE(client->identity);
-#if HAVE_SASL
+#if WITH_SASL
     virObjectUnref(client->sasl);
 #endif
     if (client->sockTimer > 0)
@@ -1181,7 +1180,7 @@ virNetServerClientDispatchWrite(virNetServerClientPtr client)
                 client->tx->donefds++;
             }
 
-#if HAVE_SASL
+#if WITH_SASL
             /* Completed this 'tx' operation, so now read for all
              * future rx/tx to be under a SASL SSF layer
              */
diff --git a/src/rpc/virnetserverclient.h b/src/rpc/virnetserverclient.h
index b11b9a9..40010c8 100644
--- a/src/rpc/virnetserverclient.h
+++ b/src/rpc/virnetserverclient.h
@@ -83,7 +83,7 @@ bool virNetServerClientHasTLSSession(virNetServerClientPtr client);
 int virNetServerClientGetTLSKeySize(virNetServerClientPtr client);
 # endif
 
-# ifdef HAVE_SASL
+# ifdef WITH_SASL
 void virNetServerClientSetSASLSession(virNetServerClientPtr client,
                                       virNetSASLSessionPtr sasl);
 # endif
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index a817999..549aabe 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -82,7 +82,7 @@ struct _virNetSocket {
 #if HAVE_GNUTLS
     virNetTLSSessionPtr tlsSession;
 #endif
-#if HAVE_SASL
+#if WITH_SASL
     virNetSASLSessionPtr saslSession;
 
     const char *saslDecoded;
@@ -1021,7 +1021,7 @@ void virNetSocketDispose(void *obj)
         virNetTLSSessionSetIOCallbacks(sock->tlsSession, NULL, NULL, NULL);
     virObjectUnref(sock->tlsSession);
 #endif
-#if HAVE_SASL
+#if WITH_SASL
     virObjectUnref(sock->saslSession);
 #endif
 
@@ -1217,7 +1217,7 @@ void virNetSocketSetTLSSession(virNetSocketPtr sock,
 }
 #endif
 
-#if HAVE_SASL
+#if WITH_SASL
 void virNetSocketSetSASLSession(virNetSocketPtr sock,
                                 virNetSASLSessionPtr sess)
 {
@@ -1239,7 +1239,7 @@ bool virNetSocketHasCachedData(virNetSocketPtr sock ATTRIBUTE_UNUSED)
         hasCached = true;
 #endif
 
-#if HAVE_SASL
+#if WITH_SASL
     if (sock->saslDecoded)
         hasCached = true;
 #endif
@@ -1267,7 +1267,7 @@ bool virNetSocketHasPendingData(virNetSocketPtr sock ATTRIBUTE_UNUSED)
 {
     bool hasPending = false;
     virMutexLock(&sock->lock);
-#if HAVE_SASL
+#if WITH_SASL
     if (sock->saslEncoded)
         hasPending = true;
 #endif
@@ -1378,7 +1378,7 @@ rewrite:
 }
 
 
-#if HAVE_SASL
+#if WITH_SASL
 static ssize_t virNetSocketReadSASL(virNetSocketPtr sock, char *buf, size_t len)
 {
     ssize_t got;
@@ -1481,7 +1481,7 @@ ssize_t virNetSocketRead(virNetSocketPtr sock, char *buf, size_t len)
 {
     ssize_t ret;
     virMutexLock(&sock->lock);
-#if HAVE_SASL
+#if WITH_SASL
     if (sock->saslSession)
         ret = virNetSocketReadSASL(sock, buf, len);
     else
@@ -1496,7 +1496,7 @@ ssize_t virNetSocketWrite(virNetSocketPtr sock, const char *buf, size_t len)
     ssize_t ret;
 
     virMutexLock(&sock->lock);
-#if HAVE_SASL
+#if WITH_SASL
     if (sock->saslSession)
         ret = virNetSocketWriteSASL(sock, buf, len);
     else
diff --git a/src/rpc/virnetsocket.h b/src/rpc/virnetsocket.h
index ce15bb8..f1cb2ab 100644
--- a/src/rpc/virnetsocket.h
+++ b/src/rpc/virnetsocket.h
@@ -30,7 +30,7 @@
 #  include "virnettlscontext.h"
 # endif
 # include "virobject.h"
-# ifdef HAVE_SASL
+# ifdef WITH_SASL
 #  include "virnetsaslcontext.h"
 # endif
 # include "virjson.h"
@@ -129,7 +129,7 @@ void virNetSocketSetTLSSession(virNetSocketPtr sock,
                                virNetTLSSessionPtr sess);
 # endif
 
-# ifdef HAVE_SASL
+# ifdef WITH_SASL
 void virNetSocketSetSASLSession(virNetSocketPtr sock,
                                 virNetSASLSessionPtr sess);
 # endif
diff --git a/tests/libvirtdconftest.c b/tests/libvirtdconftest.c
index fd033f8..01e9415 100644
--- a/tests/libvirtdconftest.c
+++ b/tests/libvirtdconftest.c
@@ -120,7 +120,7 @@ testCorrupt(const void *opaque)
         goto cleanup;
     }
 
-#if !HAVE_SASL
+#if !WITH_SASL
     if (strstr(err->message, "unsupported auth sasl")) {
         VIR_DEBUG("sasl unsupported, skipping this config");
         goto cleanup;
-- 
1.7.11.7

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]