summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Bolte <matthias.bolte@googlemail.com>2011-06-29 00:33:09 +0200
committerMatthias Bolte <matthias.bolte@googlemail.com>2011-06-29 01:53:44 +0200
commitc565b67a6afcd470a3238008ac045b540d4ebed6 (patch)
tree9b65df3231182a651a699f43bd7f87ab1c3d4708
parentbuild: fix mingw build (diff)
downloadlibvirt-c565b67a6afcd470a3238008ac045b540d4ebed6.tar.gz
libvirt-c565b67a6afcd470a3238008ac045b540d4ebed6.tar.bz2
libvirt-c565b67a6afcd470a3238008ac045b540d4ebed6.zip
Fix compilation with systemtap 1.3
Version 1.3 of <sys/sdt.h> uses this macro #define STAP_CAST(t) (size_t)t that breaks like this if t is a function remote.c:1775: error: cast from function call of type 'const char *' to non-matching type 'long unsigned int' [-Wbad-function-cast] For that to work it should probably look like this #define STAP_CAST(t) ((size_t)(t)) In systemtap 1.4 this was completely rewritten. Anyway, before commit df0b57a95a767c t was always a variable, but now also a function is used here, namely virNetSASLSessionGetIdentity. Use an intermediate variable to avoid this problem.
-rw-r--r--daemon/remote.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/daemon/remote.c b/daemon/remote.c
index 954770296..9e6cf77f2 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -1759,13 +1759,13 @@ remoteSASLFinish(virNetServerClientPtr client)
if (virNetServerClientSetIdentity(client, identity) < 0)
goto error;
-
virNetServerClientSetSASLSession(client, priv->sasl);
VIR_DEBUG("Authentication successful %d", virNetServerClientGetFD(client));
+
+ identity = virNetSASLSessionGetIdentity(priv->sasl);
PROBE(CLIENT_AUTH_ALLOW, "fd=%d, auth=%d, username=%s",
- virNetServerClientGetFD(client), REMOTE_AUTH_SASL,
- virNetSASLSessionGetIdentity(priv->sasl));
+ virNetServerClientGetFD(client), REMOTE_AUTH_SASL, identity);
virNetSASLSessionFree(priv->sasl);
priv->sasl = NULL;
@@ -1793,6 +1793,7 @@ remoteDispatchAuthSaslStart(virNetServerPtr server ATTRIBUTE_UNUSED,
int rv = -1;
struct daemonClientPrivate *priv =
virNetServerClientGetPrivateData(client);
+ const char *identity;
virMutexLock(&priv->lock);
@@ -1856,9 +1857,9 @@ authfail:
goto error;
authdeny:
+ identity = virNetSASLSessionGetIdentity(priv->sasl);
PROBE(CLIENT_AUTH_DENY, "fd=%d, auth=%d, username=%s",
- virNetServerClientGetFD(client), REMOTE_AUTH_SASL,
- virNetSASLSessionGetIdentity(priv->sasl));
+ virNetServerClientGetFD(client), REMOTE_AUTH_SASL, identity);
goto error;
error:
@@ -1888,7 +1889,7 @@ remoteDispatchAuthSaslStep(virNetServerPtr server ATTRIBUTE_UNUSED,
int rv = -1;
struct daemonClientPrivate *priv =
virNetServerClientGetPrivateData(client);
-
+ const char *identity;
virMutexLock(&priv->lock);
@@ -1952,9 +1953,9 @@ authfail:
goto error;
authdeny:
+ identity = virNetSASLSessionGetIdentity(priv->sasl);
PROBE(CLIENT_AUTH_DENY, "fd=%d, auth=%d, username=%s",
- virNetServerClientGetFD(client), REMOTE_AUTH_SASL,
- virNetSASLSessionGetIdentity(priv->sasl));
+ virNetServerClientGetFD(client), REMOTE_AUTH_SASL, identity);
goto error;
error: