mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Add conditionals to allow build without SASL
* daemon/libvirtd.c, daemon/remote.c: Add #if HAVE_SASL and suitable function stubs to allow build without SASL
This commit is contained in:
parent
dbf055efa0
commit
0e4b921a57
@ -91,7 +91,9 @@
|
|||||||
|
|
||||||
#include "configmake.h"
|
#include "configmake.h"
|
||||||
|
|
||||||
|
#if HAVE_SASL
|
||||||
virNetSASLContextPtr saslCtxt = NULL;
|
virNetSASLContextPtr saslCtxt = NULL;
|
||||||
|
#endif
|
||||||
virNetServerProgramPtr remoteProgram = NULL;
|
virNetServerProgramPtr remoteProgram = NULL;
|
||||||
virNetServerProgramPtr qemuProgram = NULL;
|
virNetServerProgramPtr qemuProgram = NULL;
|
||||||
|
|
||||||
@ -560,6 +562,7 @@ static int daemonSetupNetworking(virNetServerPtr srv,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if HAVE_SASL
|
||||||
if (config->auth_unix_rw == REMOTE_AUTH_SASL ||
|
if (config->auth_unix_rw == REMOTE_AUTH_SASL ||
|
||||||
config->auth_unix_ro == REMOTE_AUTH_SASL ||
|
config->auth_unix_ro == REMOTE_AUTH_SASL ||
|
||||||
config->auth_tcp == REMOTE_AUTH_SASL ||
|
config->auth_tcp == REMOTE_AUTH_SASL ||
|
||||||
@ -569,6 +572,7 @@ static int daemonSetupNetworking(virNetServerPtr srv,
|
|||||||
if (!saslCtxt)
|
if (!saslCtxt)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAVE_POLKIT0
|
#if HAVE_POLKIT0
|
||||||
if (auth_unix_rw == REMOTE_AUTH_POLKIT ||
|
if (auth_unix_rw == REMOTE_AUTH_POLKIT ||
|
||||||
@ -745,8 +749,10 @@ static int remoteConfigGetAuth(virConfPtr conf, const char *key, int *auth, cons
|
|||||||
|
|
||||||
if (STREQ(p->str, "none")) {
|
if (STREQ(p->str, "none")) {
|
||||||
*auth = VIR_NET_SERVER_SERVICE_AUTH_NONE;
|
*auth = VIR_NET_SERVER_SERVICE_AUTH_NONE;
|
||||||
|
#if HAVE_SASL
|
||||||
} else if (STREQ(p->str, "sasl")) {
|
} else if (STREQ(p->str, "sasl")) {
|
||||||
*auth = VIR_NET_SERVER_SERVICE_AUTH_SASL;
|
*auth = VIR_NET_SERVER_SERVICE_AUTH_SASL;
|
||||||
|
#endif
|
||||||
} else if (STREQ(p->str, "polkit")) {
|
} else if (STREQ(p->str, "polkit")) {
|
||||||
*auth = VIR_NET_SERVER_SERVICE_AUTH_POLKIT;
|
*auth = VIR_NET_SERVER_SERVICE_AUTH_POLKIT;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1653,6 +1653,7 @@ cleanup:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef HAVE_SASL
|
||||||
/*
|
/*
|
||||||
* Initializes the SASL session in prepare for authentication
|
* Initializes the SASL session in prepare for authentication
|
||||||
* and gives the client a list of allowed mechanisms to choose
|
* and gives the client a list of allowed mechanisms to choose
|
||||||
@ -1969,6 +1970,49 @@ error:
|
|||||||
virMutexUnlock(&priv->lock);
|
virMutexUnlock(&priv->lock);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
static int
|
||||||
|
remoteDispatchAuthSaslInit(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||||
|
virNetServerClientPtr client ATTRIBUTE_UNUSED,
|
||||||
|
virNetMessageHeaderPtr hdr ATTRIBUTE_UNUSED,
|
||||||
|
virNetMessageErrorPtr rerr,
|
||||||
|
remote_auth_sasl_init_ret *ret ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
VIR_WARN("Client tried unsupported SASL auth");
|
||||||
|
virNetError(VIR_ERR_AUTH_FAILED, "%s",
|
||||||
|
_("authentication failed"));
|
||||||
|
virNetMessageSaveError(rerr);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
static int
|
||||||
|
remoteDispatchAuthSaslStart(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||||
|
virNetServerClientPtr client ATTRIBUTE_UNUSED,
|
||||||
|
virNetMessageHeaderPtr hdr ATTRIBUTE_UNUSED,
|
||||||
|
virNetMessageErrorPtr rerr,
|
||||||
|
remote_auth_sasl_start_args *args ATTRIBUTE_UNUSED,
|
||||||
|
remote_auth_sasl_start_ret *ret ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
VIR_WARN("Client tried unsupported SASL auth");
|
||||||
|
virNetError(VIR_ERR_AUTH_FAILED, "%s",
|
||||||
|
_("authentication failed"));
|
||||||
|
virNetMessageSaveError(rerr);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
static int
|
||||||
|
remoteDispatchAuthSaslStep(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||||
|
virNetServerClientPtr client ATTRIBUTE_UNUSED,
|
||||||
|
virNetMessageHeaderPtr hdr ATTRIBUTE_UNUSED,
|
||||||
|
virNetMessageErrorPtr rerr,
|
||||||
|
remote_auth_sasl_step_args *args ATTRIBUTE_UNUSED,
|
||||||
|
remote_auth_sasl_step_ret *ret ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
VIR_WARN("Client tried unsupported SASL auth");
|
||||||
|
virNetError(VIR_ERR_AUTH_FAILED, "%s",
|
||||||
|
_("authentication failed"));
|
||||||
|
virNetMessageSaveError(rerr);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user