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 <[email protected]>

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

_______________________________________________
networkmanager-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/networkmanager-list

Reply via email to