render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
6ae9ed
From 342133607ff39eac851667f4a86abd9b97f3cf22 Mon Sep 17 00:00:00 2001
6ae9ed
Message-Id: <342133607ff39eac851667f4a86abd9b97f3cf22@dist-git>
6ae9ed
From: Erik Skultety <eskultet@redhat.com>
6ae9ed
Date: Tue, 2 Aug 2016 08:47:44 +0200
6ae9ed
Subject: [PATCH] admin: Retrieve the SASL context for both local and remote
6ae9ed
 connection
6ae9ed
6ae9ed
When commit 4a0e9108 added a support for client information retrieval, it made
6ae9ed
the API return SASL identity info only for clients connected remotely, yet SASL
6ae9ed
can be happily used with UNIX sockets as well.
6ae9ed
6ae9ed
Signed-off-by: Erik Skultety <eskultet@redhat.com>
6ae9ed
(cherry picked from commit 385ec6280fdad8548b5997577b91931d1ed79aaa)
6ae9ed
6ae9ed
https://bugzilla.redhat.com/show_bug.cgi?id=1361948
6ae9ed
Signed-off-by: Erik Skultety <eskultet@redhat.com>
6ae9ed
---
6ae9ed
 daemon/admin_server.c | 14 +++++++-------
6ae9ed
 1 file changed, 7 insertions(+), 7 deletions(-)
6ae9ed
6ae9ed
diff --git a/daemon/admin_server.c b/daemon/admin_server.c
6ae9ed
index 9f24f68..5bbf229 100644
6ae9ed
--- a/daemon/admin_server.c
6ae9ed
+++ b/daemon/admin_server.c
6ae9ed
@@ -237,19 +237,19 @@ adminClientGetInfo(virNetServerClientPtr client,
6ae9ed
                                  readonly) < 0)
6ae9ed
         goto cleanup;
6ae9ed
 
6ae9ed
+    if (virIdentityGetSASLUserName(identity, &attr) < 0 ||
6ae9ed
+        (attr &&
6ae9ed
+         virTypedParamsAddString(&tmpparams, nparams, &maxparams,
6ae9ed
+                                 VIR_CLIENT_INFO_SASL_USER_NAME,
6ae9ed
+                                 attr) < 0))
6ae9ed
+        goto cleanup;
6ae9ed
+
6ae9ed
     if (!virNetServerClientIsLocal(client)) {
6ae9ed
         if (virTypedParamsAddString(&tmpparams, nparams, &maxparams,
6ae9ed
                                     VIR_CLIENT_INFO_SOCKET_ADDR,
6ae9ed
                                     sock_addr) < 0)
6ae9ed
             goto cleanup;
6ae9ed
 
6ae9ed
-        if (virIdentityGetSASLUserName(identity, &attr) < 0 ||
6ae9ed
-            (attr &&
6ae9ed
-             virTypedParamsAddString(&tmpparams, nparams, &maxparams,
6ae9ed
-                                     VIR_CLIENT_INFO_SASL_USER_NAME,
6ae9ed
-                                     attr) < 0))
6ae9ed
-            goto cleanup;
6ae9ed
-
6ae9ed
         if (virIdentityGetX509DName(identity, &attr) < 0 ||
6ae9ed
             (attr &&
6ae9ed
              virTypedParamsAddString(&tmpparams, nparams, &maxparams,
6ae9ed
-- 
6ae9ed
2.9.2
6ae9ed