admin: Retrieve the SASL context for both local and remote connection

When commit 4a0e9108 added a support for client information retrieval, it made
the API return SASL identity info only for clients connected remotely, yet SASL
can be happily used with UNIX sockets as well.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Erik Skultety 2016-07-19 08:55:31 +02:00
parent fa4eea8063
commit 385ec6280f

View File

@ -237,19 +237,19 @@ adminClientGetInfo(virNetServerClientPtr client,
readonly) < 0)
goto cleanup;
if (virIdentityGetSASLUserName(identity, &attr) < 0 ||
(attr &&
virTypedParamsAddString(&tmpparams, nparams, &maxparams,
VIR_CLIENT_INFO_SASL_USER_NAME,
attr) < 0))
goto cleanup;
if (!virNetServerClientIsLocal(client)) {
if (virTypedParamsAddString(&tmpparams, nparams, &maxparams,
VIR_CLIENT_INFO_SOCKET_ADDR,
sock_addr) < 0)
goto cleanup;
if (virIdentityGetSASLUserName(identity, &attr) < 0 ||
(attr &&
virTypedParamsAddString(&tmpparams, nparams, &maxparams,
VIR_CLIENT_INFO_SASL_USER_NAME,
attr) < 0))
goto cleanup;
if (virIdentityGetX509DName(identity, &attr) < 0 ||
(attr &&
virTypedParamsAddString(&tmpparams, nparams, &maxparams,