You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/net-misc/networkmanager-openconnect/files/0.9.10.0/0017-Always-return-success-...

69 lines
2.0 KiB

From 5e899ec0dfff56ac15f9e19cccb8b8d17f792afd Mon Sep 17 00:00:00 2001
From: David Woodhouse <David.Woodhouse@intel.com>
Date: Tue, 12 Aug 2014 14:58:05 +0100
Subject: [PATCH 17/34] 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.
---
auth-dialog/main.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index b078d48..7171247 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -180,7 +180,6 @@ typedef struct auth_ui_data {
GtkWidget *last_notice_icon;
GtkTextBuffer *log;
- int retval;
int cookie_retval;
int cancel_pipes[2];
@@ -1376,7 +1375,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;
@@ -1413,13 +1411,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);
@@ -1672,7 +1668,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();
g_mutex_init(&ui_data->form_mutex);
@@ -1848,5 +1843,5 @@ int main (int argc, char **argv)
wait_for_quit ();
- return _ui_data->retval;
+ return 0;
}
--
2.2.0