Replace virNetServerClientNeedAuth with
virNetServerClientIsAuthenticated because it makes it clearer what it
means.
Signed-off-by: Marc Hartmayer <mhartmay(a)linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi(a)linux.vnet.ibm.com>
---
src/libvirt_remote.syms | 2 +-
src/rpc/virnetserverclient.c | 8 ++++----
src/rpc/virnetserverclient.h | 2 +-
src/rpc/virnetserverprogram.c | 7 +++----
4 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms
index a950bed14efc..a181c4cf7f92 100644
--- a/src/libvirt_remote.syms
+++ b/src/libvirt_remote.syms
@@ -138,12 +138,12 @@ virNetServerClientGetUNIXIdentity;
virNetServerClientImmediateClose;
virNetServerClientInit;
virNetServerClientInitKeepAlive;
+virNetServerClientIsAuthenticated;
virNetServerClientIsAuthPendingLocked;
virNetServerClientIsClosedLocked;
virNetServerClientIsLocal;
virNetServerClientIsSecure;
virNetServerClientLocalAddrStringSASL;
-virNetServerClientNeedAuth;
virNetServerClientNew;
virNetServerClientNewPostExecRestart;
virNetServerClientPreExecRestart;
diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
index 70e881b83a65..cae53753594a 100644
--- a/src/rpc/virnetserverclient.c
+++ b/src/rpc/virnetserverclient.c
@@ -1566,13 +1566,13 @@ int virNetServerClientSendMessage(virNetServerClientPtr client,
bool
-virNetServerClientNeedAuth(virNetServerClientPtr client)
+virNetServerClientIsAuthenticated(virNetServerClientPtr client)
{
- bool need;
+ bool authenticated;
virObjectLock(client);
- need = !virNetServerClientAuthMethodImpliesAuthenticated(client->auth);
+ authenticated = virNetServerClientAuthMethodImpliesAuthenticated(client->auth);
virObjectUnlock(client);
- return need;
+ return authenticated;
}
diff --git a/src/rpc/virnetserverclient.h b/src/rpc/virnetserverclient.h
index 81eac6dcec88..0fa8745191a8 100644
--- a/src/rpc/virnetserverclient.h
+++ b/src/rpc/virnetserverclient.h
@@ -147,7 +147,7 @@ const char
*virNetServerClientRemoteAddrStringURI(virNetServerClientPtr client);
int virNetServerClientSendMessage(virNetServerClientPtr client,
virNetMessagePtr msg);
-bool virNetServerClientNeedAuth(virNetServerClientPtr client);
+bool virNetServerClientIsAuthenticated(virNetServerClientPtr client);
bool virNetServerClientIsAuthPendingLocked(virNetServerClientPtr client);
void virNetServerClientSetAuthPendingLocked(virNetServerClientPtr client, bool
auth_pending);
diff --git a/src/rpc/virnetserverprogram.c b/src/rpc/virnetserverprogram.c
index 1e8dfc2f1128..557651ffbd91 100644
--- a/src/rpc/virnetserverprogram.c
+++ b/src/rpc/virnetserverprogram.c
@@ -397,11 +397,10 @@ virNetServerProgramDispatchCall(virNetServerProgramPtr prog,
goto error;
}
- /* If client is marked as needing auth, don't allow any RPC ops
- * which are except for authentication ones
- */
+ /* If the client is not authenticated, don't allow any RPC ops
+ * which are except for authentication ones */
if (dispatcher->needAuth &&
- virNetServerClientNeedAuth(client)) {
+ !virNetServerClientIsAuthenticated(client)) {
/* Explicitly *NOT* calling remoteDispatchAuthError() because
we want back-compatibility with libvirt clients which don't
support the VIR_ERR_AUTH_FAILED error code */
--
2.13.4