[network-manager-openconnect/nm-0-9-8] Always return success from auth-dialog



commit b3709a279c7e82dab34462bfc311d7d080255fc0
Author: David Woodhouse <David Woodhouse intel com>
Date:   Tue Aug 12 14:58:05 2014 +0100

    Always return success from auth-dialog
    
    We want to store the secrets even when we ultimately failed to log in.
    This was slightly suboptimal even before, when we were failing to remember
    things like the 'autoconnect' and 'certsigs' secrets. But now with HOTP
    it's particularly important that we keep track of which tokens have been
    used *even* if we end up failing to log in.
    
    Even if we don't get a valid login cookie, it's OK to return success.
    
    (cherry picked from commit 5e899ec0dfff56ac15f9e19cccb8b8d17f792afd)

 auth-dialog/main.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 80a85ff..2a3544a 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -184,7 +184,6 @@ typedef struct auth_ui_data {
        GtkWidget *last_notice_icon;
        GtkTextBuffer *log;
 
-       int retval;
        int cookie_retval;
 
        int cancel_pipes[2];
@@ -1404,7 +1403,6 @@ static gboolean cookie_obtained(auth_ui_data *ui_data)
                        gtk_widget_show_all(ui_data->ssl_box);
                        gtk_widget_set_sensitive(ui_data->cancel_button, FALSE);
                }
-               ui_data->retval = 1;
        } else if (!ui_data->cookie_retval) {
                OPENCONNECT_X509 *cert;
                gchar *key, *value;
@@ -1441,13 +1439,11 @@ static gboolean cookie_obtained(auth_ui_data *ui_data)
                                             keyring_store_passwords,
                                             NULL);
                }
-               ui_data->retval = 0;
 
                gtk_main_quit();
        } else {
                /* no cookie; user cancellation */
                gtk_widget_show (ui_data->no_form_label);
-               ui_data->retval = 1;
        }
 
        g_hash_table_remove_all (ui_data->success_secrets);
@@ -1725,7 +1721,6 @@ static auth_ui_data *init_ui_data (char *vpn_name, GHashTable *options, GHashTab
        auth_ui_data *ui_data;
 
        ui_data = g_slice_new0(auth_ui_data);
-       ui_data->retval = 1;
 
        ui_data->form_entries = g_queue_new();
 #if GLIB_CHECK_VERSION(2,31,0)
@@ -1915,5 +1910,5 @@ int main (int argc, char **argv)
 
        wait_for_quit ();
 
-       return _ui_data->retval;
+       return 0;
 }


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