=?UTF-8?q?=5BPATCH=20v2=206/7=5D=20Fix=20nm=5Fprocess=5Fauth=5Fform=28=29=20to=20clear=20=27form=5Fgrabbed=27=20and=20cancel=20keyring=20ops=20=28cherry=20picked=20from=20commit=2096a0741b154dbb3a629038b34c89469b9bd11adb=29?=
- From: Murilo Opsfelder Araujo <muriloo linux vnet ibm com>
- To: networkmanager-list gnome org
- Cc: David Woodhouse intel com
- Subject: [PATCH v2 6/7] Fix nm_process_auth_form() to clear 'form_grabbed' and cancel keyring ops (cherry picked from commit 96a0741b154dbb3a629038b34c89469b9bd11adb)
- Date: Fri, 26 Oct 2012 16:37:24 -0200
These were being done in the obsolete ui_flush() function which handled
OpenSSL UI callbacks (that libopenconnect.so.2 now catches and translates
into auth_forms). But not in nm_process_auth_form().
(cherry picked from commit 96a0741b154dbb3a629038b34c89469b9bd11adb)
Signed-off-by: Murilo Opsfelder Araujo <muriloo linux vnet ibm com>
Conflicts:
auth-dialog/main.c
---
auth-dialog/main.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 46b3199..d688b27 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -313,6 +313,7 @@ static void ssl_box_clear(auth_ui_data *ui_data)
typedef struct ui_fragment_data {
GtkWidget *widget;
GtkWidget *entry;
+ gpointer find_request;
auth_ui_data *ui_data;
#ifdef OPENCONNECT_OPENSSL
UI_STRING *uis;
@@ -590,6 +591,10 @@ static int ui_flush(UI* ui)
while (!g_queue_is_empty (ui_data->form_entries)) {
ui_fragment_data *data;
data = g_queue_pop_tail (ui_data->form_entries);
+
+ if (data->find_request)
+ gnome_keyring_cancel_request(data->find_request);
+
if (data->entry_text) {
UI_set_result(ui, data->uis, data->entry_text);
}
@@ -677,6 +682,10 @@ static void got_keyring_pw(GnomeKeyringResult result, const char *string, gpoint
/* Mark 'Save passwords' if a password is found in keyring */
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->ui_data->savepass), 1);
}
+
+ /* zero the find request so that we don’t attempt to cancel it when
+ * closing the dialog */
+ data->find_request = NULL;
}
/* This part for processing forms from openconnect directly, rather than
@@ -720,7 +729,7 @@ static gboolean ui_form (struct oc_auth_form *form)
if (opt->type != OC_FORM_OPT_PASSWORD)
data->entry_text = find_form_answer(form, opt);
else {
- gnome_keyring_find_password(
+ data->find_request = gnome_keyring_find_password(
OPENCONNECT_SCHEMA,
got_keyring_pw,
data,
@@ -805,7 +814,7 @@ static int nm_process_auth_form (void *cbdata, struct oc_auth_form *form)
}
}
-
+ ui_data->form_grabbed = 0;
g_mutex_unlock(ui_data->form_mutex);
/* -1 = cancel,
--
1.8.0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]