[PATCH 4/7] virneserverclient: Introduce virNetServerClientHasSASLSession

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We do have a similar method, serving the same purpose, for TLS, but we lack
one for SASL. So introduce one, in order for other modules to be able to find
out, if a SASL session is active, or better said, that a SASL session exists
at all.

Signed-off-by: Erik Skultety <eskultet@xxxxxxxxxx>
---
 src/rpc/virnetserverclient.c | 9 +++++++++
 src/rpc/virnetserverclient.h | 1 +
 2 files changed, 10 insertions(+)

diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
index a7b3b15..396b0cc 100644
--- a/src/rpc/virnetserverclient.c
+++ b/src/rpc/virnetserverclient.c
@@ -863,6 +863,15 @@ virNetSASLSessionPtr virNetServerClientGetSASLSession(virNetServerClientPtr clie
     virObjectUnlock(client);
     return sasl;
 }
+
+bool virNetServerClientHasSASLSession(virNetServerClientPtr client)
+{
+    bool has = false;
+    virObjectLock(client);
+    has = !!client->sasl;
+    virObjectUnlock(client);
+    return has;
+}
 #endif
 
 
diff --git a/src/rpc/virnetserverclient.h b/src/rpc/virnetserverclient.h
index 267e4ec..b576fde 100644
--- a/src/rpc/virnetserverclient.h
+++ b/src/rpc/virnetserverclient.h
@@ -91,6 +91,7 @@ int virNetServerClientGetTLSKeySize(virNetServerClientPtr client);
 # endif
 
 # ifdef WITH_SASL
+bool virNetServerClientHasSASLSession(virNetServerClientPtr client);
 void virNetServerClientSetSASLSession(virNetServerClientPtr client,
                                       virNetSASLSessionPtr sasl);
 virNetSASLSessionPtr virNetServerClientGetSASLSession(virNetServerClientPtr client);
-- 
2.4.11

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]