提交 c565b67a 编写于 作者: M Matthias Bolte

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 df0b57a9 t was always a variable, but now
also a function is used here, namely virNetSASLSessionGetIdentity.

Use an intermediate variable to avoid this problem.
上级 f05759e0
...@@ -1759,13 +1759,13 @@ remoteSASLFinish(virNetServerClientPtr client) ...@@ -1759,13 +1759,13 @@ remoteSASLFinish(virNetServerClientPtr client)
if (virNetServerClientSetIdentity(client, identity) < 0) if (virNetServerClientSetIdentity(client, identity) < 0)
goto error; goto error;
virNetServerClientSetSASLSession(client, priv->sasl); virNetServerClientSetSASLSession(client, priv->sasl);
VIR_DEBUG("Authentication successful %d", virNetServerClientGetFD(client)); VIR_DEBUG("Authentication successful %d", virNetServerClientGetFD(client));
identity = virNetSASLSessionGetIdentity(priv->sasl);
PROBE(CLIENT_AUTH_ALLOW, "fd=%d, auth=%d, username=%s", PROBE(CLIENT_AUTH_ALLOW, "fd=%d, auth=%d, username=%s",
virNetServerClientGetFD(client), REMOTE_AUTH_SASL, virNetServerClientGetFD(client), REMOTE_AUTH_SASL, identity);
virNetSASLSessionGetIdentity(priv->sasl));
virNetSASLSessionFree(priv->sasl); virNetSASLSessionFree(priv->sasl);
priv->sasl = NULL; priv->sasl = NULL;
...@@ -1793,6 +1793,7 @@ remoteDispatchAuthSaslStart(virNetServerPtr server ATTRIBUTE_UNUSED, ...@@ -1793,6 +1793,7 @@ remoteDispatchAuthSaslStart(virNetServerPtr server ATTRIBUTE_UNUSED,
int rv = -1; int rv = -1;
struct daemonClientPrivate *priv = struct daemonClientPrivate *priv =
virNetServerClientGetPrivateData(client); virNetServerClientGetPrivateData(client);
const char *identity;
virMutexLock(&priv->lock); virMutexLock(&priv->lock);
...@@ -1856,9 +1857,9 @@ authfail: ...@@ -1856,9 +1857,9 @@ authfail:
goto error; goto error;
authdeny: authdeny:
identity = virNetSASLSessionGetIdentity(priv->sasl);
PROBE(CLIENT_AUTH_DENY, "fd=%d, auth=%d, username=%s", PROBE(CLIENT_AUTH_DENY, "fd=%d, auth=%d, username=%s",
virNetServerClientGetFD(client), REMOTE_AUTH_SASL, virNetServerClientGetFD(client), REMOTE_AUTH_SASL, identity);
virNetSASLSessionGetIdentity(priv->sasl));
goto error; goto error;
error: error:
...@@ -1888,7 +1889,7 @@ remoteDispatchAuthSaslStep(virNetServerPtr server ATTRIBUTE_UNUSED, ...@@ -1888,7 +1889,7 @@ remoteDispatchAuthSaslStep(virNetServerPtr server ATTRIBUTE_UNUSED,
int rv = -1; int rv = -1;
struct daemonClientPrivate *priv = struct daemonClientPrivate *priv =
virNetServerClientGetPrivateData(client); virNetServerClientGetPrivateData(client);
const char *identity;
virMutexLock(&priv->lock); virMutexLock(&priv->lock);
...@@ -1952,9 +1953,9 @@ authfail: ...@@ -1952,9 +1953,9 @@ authfail:
goto error; goto error;
authdeny: authdeny:
identity = virNetSASLSessionGetIdentity(priv->sasl);
PROBE(CLIENT_AUTH_DENY, "fd=%d, auth=%d, username=%s", PROBE(CLIENT_AUTH_DENY, "fd=%d, auth=%d, username=%s",
virNetServerClientGetFD(client), REMOTE_AUTH_SASL, virNetServerClientGetFD(client), REMOTE_AUTH_SASL, identity);
virNetSASLSessionGetIdentity(priv->sasl));
goto error; goto error;
error: error:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册