1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

virneserverclient: Introduce virNetServerClientHasSASLSession

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@redhat.com>
This commit is contained in:
Erik Skultety 2016-04-22 12:54:26 +02:00
parent 9b45c9f049
commit bde2cb6136
3 changed files with 11 additions and 0 deletions

View File

@ -27,6 +27,7 @@ virNetSASLSessionServerStep;
# rpc/virnetserverclient.h
virNetServerClientGetSASLSession;
virNetServerClientHasSASLSession;
virNetServerClientSetSASLSession;

View File

@ -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

View File

@ -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);