]> xenbits.xensource.com Git - libvirt.git/commitdiff
admin: Retrieve the SASL context for both local and remote connection
authorErik Skultety <eskultet@redhat.com>
Tue, 19 Jul 2016 06:55:31 +0000 (08:55 +0200)
committerErik Skultety <eskultet@redhat.com>
Tue, 2 Aug 2016 06:25:42 +0000 (08:25 +0200)
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>
daemon/admin_server.c

index 9f24f680bec608a7a4f1ffddaabecafc4b629040..5bbf2298a688b4eb8041a630badad4ed5d7bad2d 100644 (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,