[NetworkManager-openvpn/bg/ask-username: 4/7] auth-dialog: ask hints in addition to other secrets



commit fda181b5ce669d89982920a4ac07f26d158cc86d
Author: Beniamino Galvani <bgalvani redhat com>
Date:   Thu Oct 11 16:40:25 2018 +0200

    auth-dialog: ask hints in addition to other secrets

 auth-dialog/main.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)
---
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 009b4b7..262ff3f 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -332,18 +332,15 @@ get_passwords_required (GHashTable *data,
        guint i;
 
        /* If hints are given, then always ask for what the hints require */
-       if (hints) {
-               for (iter = hints; iter && *iter; iter++) {
-                       if (!*prompt && g_str_has_prefix (*iter, VPN_MSG_TAG))
-                               *prompt = g_strdup (*iter + strlen (VPN_MSG_TAG));
-                       else {
-                               for (i = 0; i < _FIELD_TYPE_NUM; i++) {
-                                       if (nm_streq (*iter, fields[i].key))
-                                               fields[i].needed = TRUE;
-                               }
+       for (iter = hints; iter && *iter; iter++) {
+               if (!*prompt && g_str_has_prefix (*iter, VPN_MSG_TAG))
+                       *prompt = g_strdup (*iter + strlen (VPN_MSG_TAG));
+               else {
+                       for (i = 0; i < _FIELD_TYPE_NUM; i++) {
+                               if (nm_streq (*iter, fields[i].key))
+                                       fields[i].needed = TRUE;
                        }
                }
-               goto done;
        }
 
        ctype = g_hash_table_lookup (data, NM_OPENVPN_KEY_CONNECTION_TYPE);
@@ -378,7 +375,6 @@ get_passwords_required (GHashTable *data,
                        fields[FIELD_TYPE_PROXY_PASSWORD].needed = TRUE;
        }
 
-done:
        for (i = 0; i < _FIELD_TYPE_NUM; i++) {
                if (fields[i].needed)
                        return TRUE;


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