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 | 12 ++++++------ src/rpc/virnetserverclient.h | 2 +- src/rpc/virnetsocket.c | 16 ++++++++-------- src/rpc/virnetsocket.h | 4 ++-- tests/libvirtdconftest.c | 2 +- 15 files changed, 42 insertions(+), 42 deletions(-) diff --git a/configure.ac b/configure.ac index c58c1f3..94929ce 100644 --- a/configure.ac +++ b/configure.ac @@ -1085,11 +1085,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 3405c67..26f4695 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -382,7 +382,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 5374bcc..b9521b3 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 1156bd6..4286c4d 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -97,7 +97,7 @@ #include "configmake.h" -#if HAVE_SASL +#if WITH_SASL virNetSASLContextPtr saslCtxt = NULL; #endif virNetServerProgramPtr remoteProgram = NULL; @@ -560,7 +560,7 @@ static int daemonSetupNetworking(virNetServerPtr srv, } } -#if HAVE_SASL +#if WITH_SASL if (config->auth_unix_rw == REMOTE_AUTH_SASL || config->auth_unix_ro == REMOTE_AUTH_SASL || config->auth_tcp == REMOTE_AUTH_SASL || diff --git a/daemon/libvirtd.h b/daemon/libvirtd.h index 726a1fb..b8941f4 100644 --- a/daemon/libvirtd.h +++ b/daemon/libvirtd.h @@ -35,7 +35,7 @@ # include "qemu_protocol.h" # include "logging.h" # include "threads.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 a3eda9c..87f8761 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -2406,7 +2406,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 4f9de11..7c5db89 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1340,7 +1340,7 @@ if WITH_XENXS USED_SYM_FILES += libvirt_xenxs.syms endif -if HAVE_SASL +if WITH_SASL USED_SYM_FILES += libvirt_sasl.syms endif @@ -1551,7 +1551,7 @@ else EXTRA_DIST += \ rpc/virnetsshsession.h rpc/virnetsshsession.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 dce12e2..cdcffd3 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -116,7 +116,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 @@ -3462,7 +3462,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 && @@ -3505,7 +3505,7 @@ remoteAuthenticate (virConnectPtr conn, struct private_data *priv, -#if HAVE_SASL +#if WITH_SASL static int remoteAuthCredVir2SASL(int vircred) { switch (vircred) { @@ -4042,7 +4042,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 727ed67..5551bd9 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -79,7 +79,7 @@ struct _virNetClient { /* For incoming message packets */ virNetMessage msg; -#if HAVE_SASL +#if WITH_SASL virNetSASLSessionPtr sasl; #endif @@ -628,7 +628,7 @@ void virNetClientDispose(void *obj) virNetSocketRemoveIOCallback(client->sock); virObjectUnref(client->sock); virObjectUnref(client->tls); -#if HAVE_SASL +#if WITH_SASL virObjectUnref(client->sasl); #endif @@ -665,7 +665,7 @@ virNetClientCloseLocked(virNetClientPtr client) client->sock = NULL; virObjectUnref(client->tls); client->tls = NULL; -#if HAVE_SASL +#if WITH_SASL virObjectUnref(client->sasl); client->sasl = NULL; #endif @@ -733,7 +733,7 @@ void virNetClientClose(virNetClientPtr client) } -#if HAVE_SASL +#if WITH_SASL void virNetClientSetSASLSession(virNetClientPtr client, virNetSASLSessionPtr sasl) { @@ -854,7 +854,7 @@ bool virNetClientIsEncrypted(virNetClientPtr client) virNetClientLock(client); if (client->tls) ret = true; -#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 d10224f..82def00 100644 --- a/src/rpc/virnetclient.h +++ b/src/rpc/virnetclient.h @@ -25,7 +25,7 @@ # include "virnettlscontext.h" # include "virnetmessage.h" -# ifdef HAVE_SASL +# ifdef WITH_SASL # include "virnetsaslcontext.h" # endif # include "virnetclientprogram.h" @@ -102,7 +102,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 acd2b4d..c61682a 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 @@ -68,7 +68,7 @@ struct _virNetServerClient char *identity; virNetTLSContextPtr tlsCtxt; virNetTLSSessionPtr tls; -#if HAVE_SASL +#if WITH_SASL virNetSASLSessionPtr sasl; #endif int sockTimer; /* Timer to be fired upon cached data, @@ -482,7 +482,7 @@ bool virNetServerClientIsSecure(virNetServerClientPtr client) virNetServerClientLock(client); if (client->tls) secure = true; -#if HAVE_SASL +#if WITH_SASL if (client->sasl) secure = true; #endif @@ -493,7 +493,7 @@ bool virNetServerClientIsSecure(virNetServerClientPtr client) } -#if HAVE_SASL +#if WITH_SASL void virNetServerClientSetSASLSession(virNetServerClientPtr client, virNetSASLSessionPtr sasl) { @@ -590,7 +590,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) @@ -1002,7 +1002,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 f950c61..1282bc0 100644 --- a/src/rpc/virnetserverclient.h +++ b/src/rpc/virnetserverclient.h @@ -64,7 +64,7 @@ bool virNetServerClientGetReadonly(virNetServerClientPtr client); bool virNetServerClientHasTLSSession(virNetServerClientPtr client); int virNetServerClientGetTLSKeySize(virNetServerClientPtr client); -# 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 5a48300..96dada2 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -76,7 +76,7 @@ struct _virNetSocket { char *remoteAddrStr; virNetTLSSessionPtr tlsSession; -#if HAVE_SASL +#if WITH_SASL virNetSASLSessionPtr saslSession; const char *saslDecoded; @@ -903,7 +903,7 @@ void virNetSocketDispose(void *obj) if (sock->tlsSession) virNetTLSSessionSetIOCallbacks(sock->tlsSession, NULL, NULL, NULL); virObjectUnref(sock->tlsSession); -#if HAVE_SASL +#if WITH_SASL virObjectUnref(sock->saslSession); #endif @@ -1074,7 +1074,7 @@ void virNetSocketSetTLSSession(virNetSocketPtr sock, } -#if HAVE_SASL +#if WITH_SASL void virNetSocketSetSASLSession(virNetSocketPtr sock, virNetSASLSessionPtr sess) { @@ -1096,7 +1096,7 @@ bool virNetSocketHasCachedData(virNetSocketPtr sock ATTRIBUTE_UNUSED) hasCached = true; #endif -#if HAVE_SASL +#if WITH_SASL if (sock->saslDecoded) hasCached = true; #endif @@ -1124,7 +1124,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 @@ -1227,7 +1227,7 @@ rewrite: } -#if HAVE_SASL +#if WITH_SASL static ssize_t virNetSocketReadSASL(virNetSocketPtr sock, char *buf, size_t len) { ssize_t got; @@ -1330,7 +1330,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 @@ -1345,7 +1345,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 75b66c5..9eebd68 100644 --- a/src/rpc/virnetsocket.h +++ b/src/rpc/virnetsocket.h @@ -28,7 +28,7 @@ # include "command.h" # include "virnettlscontext.h" # include "virobject.h" -# ifdef HAVE_SASL +# ifdef WITH_SASL # include "virnetsaslcontext.h" # endif @@ -119,7 +119,7 @@ int virNetSocketRecvFD(virNetSocketPtr sock, int *fd); void virNetSocketSetTLSSession(virNetSocketPtr sock, virNetTLSSessionPtr sess); -# ifdef HAVE_SASL +# ifdef WITH_SASL void virNetSocketSetSASLSession(virNetSocketPtr sock, virNetSASLSessionPtr sess); # endif diff --git a/tests/libvirtdconftest.c b/tests/libvirtdconftest.c index a6e1f35..a60b927 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.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list