[virt-viewer: PATCH 3/3] Auto fill the username field in the auth dialog

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/virt-viewer.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/virt-viewer.c b/src/virt-viewer.c
index 513c0b6..8346854 100644
--- a/src/virt-viewer.c
+++ b/src/virt-viewer.c
@@ -640,6 +640,12 @@ virt_viewer_auth_libvirt_credentials(virConnectCredentialPtr cred,
     if (username || password) {
         VirtViewerWindow *vwin = virt_viewer_app_get_main_window(VIRT_VIEWER_APP(app));
         GtkWindow *win = virt_viewer_window_get_window(vwin);
+
+        if (*username == NULL) {
+            /* username will be freed inside the virt_viewer_auth_collect_credentials */
+            *username = g_strdup (g_get_user_name());
+        }
+
         priv->auth_cancelled = !virt_viewer_auth_collect_credentials(win,
                                                                      "libvirt",
                                                                      app->priv->uri,
-- 
1.9.3

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux