Blame SOURCES/0041-remote-viewer-Show-authentication-dialog-again-if-in.patch

5bafe0
From 8e29fa411c7ea10d95bb290fe94d9be965153142 Mon Sep 17 00:00:00 2001
5bafe0
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
5bafe0
Date: Thu, 8 Jun 2017 17:59:54 -0300
5bafe0
Subject: [PATCH virt-viewer 41/41] remote-viewer: Show authentication dialog
5bafe0
 again if in kiosk mode and connecting to ovirt
5bafe0
5bafe0
Similar to previous commit 5d9e6d2338cbb680fe761b86e6ca433b1234e6e0, now
5bafe0
dealing with the case of connecting directly to ovirt:// URIs, which was
5bafe0
left behind.
5bafe0
5bafe0
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1459808
5bafe0
5bafe0
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
5bafe0
---
5bafe0
 src/remote-viewer.c | 14 ++++++++++----
5bafe0
 1 file changed, 10 insertions(+), 4 deletions(-)
5bafe0
5bafe0
diff --git a/src/remote-viewer.c b/src/remote-viewer.c
5bafe0
index 451fb1d..d927f8a 100644
5bafe0
--- a/src/remote-viewer.c
5bafe0
+++ b/src/remote-viewer.c
5bafe0
@@ -742,19 +742,25 @@ authenticate_cb(RestProxy *proxy, G_GNUC_UNUSED RestProxyAuth *auth,
5bafe0
     gchar *password = NULL;
5bafe0
     VirtViewerWindow *window;
5bafe0
     gboolean success = FALSE;
5bafe0
+    gboolean kiosk = FALSE;
5bafe0
 
5bafe0
     g_object_get(proxy,
5bafe0
                  "username", &username,
5bafe0
                  NULL);
5bafe0
 
5bafe0
+    g_object_get(G_OBJECT(user_data), "kiosk", &kiosk, NULL);
5bafe0
+
5bafe0
     if (username == NULL || *username == '\0')
5bafe0
         username = g_strdup(g_get_user_name());
5bafe0
 
5bafe0
     window = virt_viewer_app_get_main_window(VIRT_VIEWER_APP(user_data));
5bafe0
-    success = virt_viewer_auth_collect_credentials(virt_viewer_window_get_window(window),
5bafe0
-                                                   "oVirt",
5bafe0
-                                                   NULL,
5bafe0
-                                                   &username, &password);
5bafe0
+    do {
5bafe0
+        success = virt_viewer_auth_collect_credentials(virt_viewer_window_get_window(window),
5bafe0
+                                                       "oVirt",
5bafe0
+                                                       NULL,
5bafe0
+                                                       &username, &password);
5bafe0
+    } while (kiosk && !success);
5bafe0
+
5bafe0
     if (success) {
5bafe0
         g_object_set(G_OBJECT(proxy),
5bafe0
                      "username", username,
5bafe0
-- 
5bafe0
2.9.4
5bafe0