Convert HAVE_SASL to WITH_SASL

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2012-09-20 12:58:29 +01:00
parent a38dbf6673
commit 321a7d53f3
15 changed files with 42 additions and 43 deletions

View File

@ -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])

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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
@ -1786,7 +1786,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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
*/

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;