|
|
@ -1,5 +1,5 @@
|
|
|
|
--- evolution-data-server-1.11.91/libedataserverui/e-passwords.c.e-passwords 2007-08-24 08:48:15.000000000 +0200
|
|
|
|
--- evolution-data-server-1.11.92/libedataserverui/e-passwords.c.e-passwords 2007-09-02 14:54:22.000000000 -0400
|
|
|
|
+++ evolution-data-server-1.11.91/libedataserverui/e-passwords.c 2007-08-28 15:25:45.000000000 +0200
|
|
|
|
+++ evolution-data-server-1.11.92/libedataserverui/e-passwords.c 2007-09-03 23:13:10.000000000 -0400
|
|
|
|
@@ -23,18 +23,29 @@
|
|
|
|
@@ -23,18 +23,29 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
@ -340,10 +340,7 @@
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
-ep_msg_free(EPassMsg *msg)
|
|
|
|
-ep_msg_free(EPassMsg *msg)
|
|
|
|
+ep_msg_dispatch (EPassMsg *msg)
|
|
|
|
+ep_msg_dispatch (EPassMsg *msg)
|
|
|
|
{
|
|
|
|
+{
|
|
|
|
- e_msgport_destroy(msg->msg.reply_port);
|
|
|
|
|
|
|
|
- g_free(msg->password);
|
|
|
|
|
|
|
|
- g_free(msg);
|
|
|
|
|
|
|
|
+ msg->callback (msg);
|
|
|
|
+ msg->callback (msg);
|
|
|
|
+ e_flag_set (msg->done);
|
|
|
|
+ e_flag_set (msg->done);
|
|
|
|
+}
|
|
|
|
+}
|
|
|
@ -361,13 +358,11 @@
|
|
|
|
+ g_async_queue_unlock (express_queue);
|
|
|
|
+ g_async_queue_unlock (express_queue);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return success;
|
|
|
|
+ return success;
|
|
|
|
}
|
|
|
|
+}
|
|
|
|
|
|
|
|
+
|
|
|
|
static void
|
|
|
|
+static void
|
|
|
|
-ep_msg_send(EPassMsg *msg)
|
|
|
|
|
|
|
|
+ep_msg_send (EPassMsg *msg)
|
|
|
|
+ep_msg_send (EPassMsg *msg)
|
|
|
|
{
|
|
|
|
+{
|
|
|
|
- int needidle = 0;
|
|
|
|
|
|
|
|
+ GMainContext *context;
|
|
|
|
+ GMainContext *context;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ context = g_main_context_default ();
|
|
|
|
+ context = g_main_context_default ();
|
|
|
@ -377,12 +372,7 @@
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if (!(msg->expedite && ep_msg_expedite (msg)))
|
|
|
|
+ if (!(msg->expedite && ep_msg_expedite (msg)))
|
|
|
|
+ g_thread_pool_push (dispatcher, msg, NULL);
|
|
|
|
+ g_thread_pool_push (dispatcher, msg, NULL);
|
|
|
|
|
|
|
|
+
|
|
|
|
- LOCK();
|
|
|
|
|
|
|
|
- e_dlist_addtail(&request_list, (EDListNode *)&msg->msg);
|
|
|
|
|
|
|
|
- if (!idle_id) {
|
|
|
|
|
|
|
|
- if (!msg->ismain)
|
|
|
|
|
|
|
|
- idle_id = g_idle_add(ep_idle_dispatch, NULL);
|
|
|
|
|
|
|
|
+ /* Don't block the main loop. */
|
|
|
|
+ /* Don't block the main loop. */
|
|
|
|
+ if (g_main_context_is_owner (context))
|
|
|
|
+ if (g_main_context_is_owner (context))
|
|
|
|
+ while (!e_flag_is_set (msg->done))
|
|
|
|
+ while (!e_flag_is_set (msg->done))
|
|
|
@ -393,7 +383,10 @@
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+static void
|
|
|
|
+static void
|
|
|
|
+ep_msg_free (EPassMsg *msg)
|
|
|
|
+ep_msg_free (EPassMsg *msg)
|
|
|
|
+{
|
|
|
|
{
|
|
|
|
|
|
|
|
- e_msgport_destroy(msg->msg.reply_port);
|
|
|
|
|
|
|
|
- g_free(msg->password);
|
|
|
|
|
|
|
|
- g_free(msg);
|
|
|
|
+ e_flag_free (msg->done);
|
|
|
|
+ e_flag_free (msg->done);
|
|
|
|
+ g_slice_free (EPassMsg, msg);
|
|
|
|
+ g_slice_free (EPassMsg, msg);
|
|
|
|
+}
|
|
|
|
+}
|
|
|
@ -414,9 +407,10 @@
|
|
|
|
+ data->flags = flags;
|
|
|
|
+ data->flags = flags;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return data;
|
|
|
|
+ return data;
|
|
|
|
+}
|
|
|
|
}
|
|
|
|
+
|
|
|
|
|
|
|
|
+static void
|
|
|
|
static void
|
|
|
|
|
|
|
|
-ep_msg_send(EPassMsg *msg)
|
|
|
|
+ep_dialog_data_free (EPassDialogData *data)
|
|
|
|
+ep_dialog_data_free (EPassDialogData *data)
|
|
|
|
+{
|
|
|
|
+{
|
|
|
|
+ e_flag_free (data->done);
|
|
|
|
+ e_flag_free (data->done);
|
|
|
@ -425,9 +419,15 @@
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+static gboolean
|
|
|
|
+static gboolean
|
|
|
|
+ep_dialog_run (EPassMsg *msg)
|
|
|
|
+ep_dialog_run (EPassMsg *msg)
|
|
|
|
+{
|
|
|
|
{
|
|
|
|
|
|
|
|
- int needidle = 0;
|
|
|
|
+ /* This function must run in the main thread. */
|
|
|
|
+ /* This function must run in the main thread. */
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
- LOCK();
|
|
|
|
|
|
|
|
- e_dlist_addtail(&request_list, (EDListNode *)&msg->msg);
|
|
|
|
|
|
|
|
- if (!idle_id) {
|
|
|
|
|
|
|
|
- if (!msg->ismain)
|
|
|
|
|
|
|
|
- idle_id = g_idle_add(ep_idle_dispatch, NULL);
|
|
|
|
+ EPassDialogData *data = msg->data;
|
|
|
|
+ EPassDialogData *data = msg->data;
|
|
|
|
+ GtkBox *box;
|
|
|
|
+ GtkBox *box;
|
|
|
|
+ GtkWidget *dialog;
|
|
|
|
+ GtkWidget *dialog;
|
|
|
@ -524,7 +524,7 @@
|
|
|
|
{
|
|
|
|
{
|
|
|
|
GnomeKeyringAttributeList *attributes;
|
|
|
|
GnomeKeyringAttributeList *attributes;
|
|
|
|
GnomeKeyringResult result;
|
|
|
|
GnomeKeyringResult result;
|
|
|
|
@@ -203,11 +436,8 @@ ep_clear_passwords_keyring(EPassMsg *msg
|
|
|
|
@@ -203,11 +436,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
result = gnome_keyring_get_default_keyring_sync (&default_keyring);
|
|
|
|
result = gnome_keyring_get_default_keyring_sync (&default_keyring);
|
|
|
|
if (!default_keyring) {
|
|
|
|
if (!default_keyring) {
|
|
|
@ -538,7 +538,7 @@
|
|
|
|
default_keyring = g_strdup ("default");
|
|
|
|
default_keyring = g_strdup ("default");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -232,38 +462,44 @@ ep_clear_passwords_keyring(EPassMsg *msg
|
|
|
|
@@ -232,38 +462,44 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
g_free (default_keyring);
|
|
|
|
g_free (default_keyring);
|
|
|
@ -552,15 +552,15 @@
|
|
|
|
+ep_clear_passwords_keyfile (EPassMsg *msg)
|
|
|
|
+ep_clear_passwords_keyfile (EPassMsg *msg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
- char *path;
|
|
|
|
- char *path;
|
|
|
|
-
|
|
|
|
|
|
|
|
- path = g_strdup_printf ("/Evolution/Passwords-%s", msg->component);
|
|
|
|
|
|
|
|
+ gchar *group;
|
|
|
|
+ gchar *group;
|
|
|
|
+ GError *error = NULL;
|
|
|
|
+ GError *error = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
- gnome_config_private_clean_section (path);
|
|
|
|
- path = g_strdup_printf ("/Evolution/Passwords-%s", msg->component);
|
|
|
|
- gnome_config_private_sync_file ("/Evolution");
|
|
|
|
|
|
|
|
+ group = ep_key_file_get_group (msg->component);
|
|
|
|
+ group = ep_key_file_get_group (msg->component);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- gnome_config_private_clean_section (path);
|
|
|
|
|
|
|
|
- gnome_config_private_sync_file ("/Evolution");
|
|
|
|
|
|
|
|
-
|
|
|
|
- g_free (path);
|
|
|
|
- g_free (path);
|
|
|
|
+ g_key_file_remove_group (key_file, group, &error);
|
|
|
|
+ g_key_file_remove_group (key_file, group, &error);
|
|
|
|
+ if (error == NULL)
|
|
|
|
+ if (error == NULL)
|
|
|
@ -601,7 +601,7 @@
|
|
|
|
{
|
|
|
|
{
|
|
|
|
GnomeKeyringAttributeList *attributes;
|
|
|
|
GnomeKeyringAttributeList *attributes;
|
|
|
|
GnomeKeyringResult result;
|
|
|
|
GnomeKeyringResult result;
|
|
|
|
@@ -272,11 +508,8 @@ ep_forget_passwords_keyring(EPassMsg *ms
|
|
|
|
@@ -272,11 +508,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
result = gnome_keyring_get_default_keyring_sync (&default_keyring);
|
|
|
|
result = gnome_keyring_get_default_keyring_sync (&default_keyring);
|
|
|
|
if (!default_keyring) {
|
|
|
|
if (!default_keyring) {
|
|
|
@ -615,7 +615,7 @@
|
|
|
|
default_keyring = g_strdup ("default");
|
|
|
|
default_keyring = g_strdup ("default");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
d(g_print("Get Default %d\n", result));
|
|
|
|
d(g_print("Get Default %d\n", result));
|
|
|
|
@@ -301,68 +534,53 @@ ep_forget_passwords_keyring(EPassMsg *ms
|
|
|
|
@@ -301,68 +534,53 @@
|
|
|
|
g_free (default_keyring);
|
|
|
|
g_free (default_keyring);
|
|
|
|
|
|
|
|
|
|
|
|
/* free up the session passwords */
|
|
|
|
/* free up the session passwords */
|
|
|
@ -711,7 +711,7 @@
|
|
|
|
guint32 item_id;
|
|
|
|
guint32 item_id;
|
|
|
|
|
|
|
|
|
|
|
|
if (!strcmp (uri->protocol, "ldap") && !uri->user) {
|
|
|
|
if (!strcmp (uri->protocol, "ldap") && !uri->user) {
|
|
|
|
@@ -394,48 +612,48 @@ ep_remember_password_keyring(EPassMsg *m
|
|
|
|
@@ -394,48 +612,48 @@
|
|
|
|
gnome_keyring_attribute_list_free (attributes);
|
|
|
|
gnome_keyring_attribute_list_free (attributes);
|
|
|
|
|
|
|
|
|
|
|
|
/* now remove it from our session hash */
|
|
|
|
/* now remove it from our session hash */
|
|
|
@ -789,7 +789,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef WITH_GNOME_KEYRING
|
|
|
|
#ifdef WITH_GNOME_KEYRING
|
|
|
|
@@ -446,7 +664,6 @@ ep_forget_password_keyring (EPassMsg *ms
|
|
|
|
@@ -446,7 +664,6 @@
|
|
|
|
GnomeKeyringResult result;
|
|
|
|
GnomeKeyringResult result;
|
|
|
|
GList *matches = NULL, *tmp;
|
|
|
|
GList *matches = NULL, *tmp;
|
|
|
|
char *default_keyring = NULL;
|
|
|
|
char *default_keyring = NULL;
|
|
|
@ -797,7 +797,7 @@
|
|
|
|
EUri *uri = e_uri_new (msg->key);
|
|
|
|
EUri *uri = e_uri_new (msg->key);
|
|
|
|
|
|
|
|
|
|
|
|
if (!strcmp (uri->protocol, "ldap") && !uri->user) {
|
|
|
|
if (!strcmp (uri->protocol, "ldap") && !uri->user) {
|
|
|
|
@@ -460,12 +677,7 @@ ep_forget_password_keyring (EPassMsg *ms
|
|
|
|
@@ -460,12 +677,7 @@
|
|
|
|
uri->user = keycopy;
|
|
|
|
uri->user = keycopy;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -811,7 +811,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
if (!uri->host && !uri->user)
|
|
|
|
if (!uri->host && !uri->user)
|
|
|
|
/* No need to remove from keyring for pass phrases */
|
|
|
|
/* No need to remove from keyring for pass phrases */
|
|
|
|
@@ -524,36 +736,45 @@ ep_forget_password_keyring (EPassMsg *ms
|
|
|
|
@@ -524,36 +736,45 @@
|
|
|
|
g_free (default_keyring);
|
|
|
|
g_free (default_keyring);
|
|
|
|
|
|
|
|
|
|
|
|
exit:
|
|
|
|
exit:
|
|
|
@ -878,7 +878,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef WITH_GNOME_KEYRING
|
|
|
|
#ifdef WITH_GNOME_KEYRING
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
@@ -562,11 +783,11 @@ ep_get_password_keyring (EPassMsg *msg)
|
|
|
|
@@ -562,11 +783,11 @@
|
|
|
|
char *passwd;
|
|
|
|
char *passwd;
|
|
|
|
GnomeKeyringAttributeList *attributes;
|
|
|
|
GnomeKeyringAttributeList *attributes;
|
|
|
|
GnomeKeyringResult result;
|
|
|
|
GnomeKeyringResult result;
|
|
|
@ -893,7 +893,7 @@
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
EUri *uri = e_uri_new (msg->key);
|
|
|
|
EUri *uri = e_uri_new (msg->key);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -630,288 +851,154 @@ ep_get_password_keyring (EPassMsg *msg)
|
|
|
|
@@ -630,288 +851,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
e_uri_free (uri);
|
|
|
|
e_uri_free (uri);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -958,11 +958,6 @@
|
|
|
|
- g_free (okey);
|
|
|
|
- g_free (okey);
|
|
|
|
- g_free (value);
|
|
|
|
- g_free (value);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
|
|
- g_hash_table_insert (passwords, g_strdup (msg->key), g_strdup (msg->oldpass));
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
|
- if (!msg->noreply)
|
|
|
|
|
|
|
|
- e_msgport_reply(&msg->msg);
|
|
|
|
|
|
|
|
+#ifdef WITH_GNOME_KEYRING
|
|
|
|
+#ifdef WITH_GNOME_KEYRING
|
|
|
|
+ if (gnome_keyring_is_available ())
|
|
|
|
+ if (gnome_keyring_is_available ())
|
|
|
|
+ ep_get_password_keyring (msg);
|
|
|
|
+ ep_get_password_keyring (msg);
|
|
|
@ -971,36 +966,36 @@
|
|
|
|
+#else
|
|
|
|
+#else
|
|
|
|
+ ep_get_password_keyfile (msg);
|
|
|
|
+ ep_get_password_keyfile (msg);
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- g_hash_table_insert (passwords, g_strdup (msg->key), g_strdup (msg->oldpass));
|
|
|
|
|
|
|
|
+static void
|
|
|
|
|
|
|
|
+ep_add_password (EPassMsg *msg)
|
|
|
|
|
|
|
|
+{
|
|
|
|
|
|
|
|
+ gchar *key = g_strdup (msg->key);
|
|
|
|
|
|
|
|
+ gchar *password = g_strdup (msg->password);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- if (!msg->noreply)
|
|
|
|
|
|
|
|
- e_msgport_reply(&msg->msg);
|
|
|
|
|
|
|
|
+ g_hash_table_insert (password_cache, key, password);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-static void ep_ask_password(EPassMsg *msg);
|
|
|
|
-static void ep_ask_password(EPassMsg *msg);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
-pass_response(GtkDialog *dialog, int response, void *data)
|
|
|
|
-pass_response(GtkDialog *dialog, int response, void *data)
|
|
|
|
+ep_add_password (EPassMsg *msg)
|
|
|
|
+ep_ask_password (EPassMsg *msg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
- EPassMsg *msg = data;
|
|
|
|
- EPassMsg *msg = data;
|
|
|
|
- int type = msg->flags & E_PASSWORDS_REMEMBER_MASK;
|
|
|
|
- int type = msg->flags & E_PASSWORDS_REMEMBER_MASK;
|
|
|
|
- EDList pending = E_DLIST_INITIALISER(pending);
|
|
|
|
- EDList pending = E_DLIST_INITIALISER(pending);
|
|
|
|
- EPassMsg *mw, *mn;
|
|
|
|
- EPassMsg *mw, *mn;
|
|
|
|
+ gchar *key = g_strdup (msg->key);
|
|
|
|
|
|
|
|
+ gchar *password = g_strdup (msg->password);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- if (response == GTK_RESPONSE_OK) {
|
|
|
|
|
|
|
|
- msg->password = g_strdup(gtk_entry_get_text((GtkEntry *)msg->entry));
|
|
|
|
|
|
|
|
+ g_hash_table_insert (password_cache, key, password);
|
|
|
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- if (type != E_PASSWORDS_REMEMBER_NEVER) {
|
|
|
|
|
|
|
|
- int noreply = msg->noreply;
|
|
|
|
|
|
|
|
+static void
|
|
|
|
|
|
|
|
+ep_ask_password (EPassMsg *msg)
|
|
|
|
|
|
|
|
+{
|
|
|
|
|
|
|
|
+ EPassDialogData *data = msg->data;
|
|
|
|
+ EPassDialogData *data = msg->data;
|
|
|
|
+ gchar *password;
|
|
|
|
+ gchar *password;
|
|
|
|
+ gint remember;
|
|
|
|
+ gint remember;
|
|
|
|
|
|
|
|
|
|
|
|
- *msg->remember = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (msg->check));
|
|
|
|
- if (response == GTK_RESPONSE_OK) {
|
|
|
|
|
|
|
|
- msg->password = g_strdup(gtk_entry_get_text((GtkEntry *)msg->entry));
|
|
|
|
+ /* Open the express queue for this key. This allows us to catch
|
|
|
|
+ /* Open the express queue for this key. This allows us to catch
|
|
|
|
+ * incoming operations on this key while waiting for the user to
|
|
|
|
+ * incoming operations on this key while waiting for the user to
|
|
|
|
+ * provide a password. Once we have the password, immediately
|
|
|
|
+ * provide a password. Once we have the password, immediately
|
|
|
@ -1009,10 +1004,17 @@
|
|
|
|
+ express_key = msg->key;
|
|
|
|
+ express_key = msg->key;
|
|
|
|
+ g_async_queue_unlock (express_queue);
|
|
|
|
+ g_async_queue_unlock (express_queue);
|
|
|
|
|
|
|
|
|
|
|
|
- msg->noreply = 1;
|
|
|
|
- if (type != E_PASSWORDS_REMEMBER_NEVER) {
|
|
|
|
|
|
|
|
- int noreply = msg->noreply;
|
|
|
|
+ if (data->flags & E_PASSWORDS_REPROMPT)
|
|
|
|
+ if (data->flags & E_PASSWORDS_REPROMPT)
|
|
|
|
+ ep_get_password (msg);
|
|
|
|
+ ep_get_password (msg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- *msg->remember = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (msg->check));
|
|
|
|
|
|
|
|
+ /* Run the password dialog in the main thread. */
|
|
|
|
|
|
|
|
+ g_idle_add ((GSourceFunc) ep_dialog_run, msg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- msg->noreply = 1;
|
|
|
|
|
|
|
|
-
|
|
|
|
- if (*msg->remember || type == E_PASSWORDS_REMEMBER_FOREVER) {
|
|
|
|
- if (*msg->remember || type == E_PASSWORDS_REMEMBER_FOREVER) {
|
|
|
|
- msg->oldpass = msg->password;
|
|
|
|
- msg->oldpass = msg->password;
|
|
|
|
- ep_add_password(msg);
|
|
|
|
- ep_add_password(msg);
|
|
|
@ -1028,18 +1030,26 @@
|
|
|
|
- if (*msg->remember && type == E_PASSWORDS_REMEMBER_FOREVER)
|
|
|
|
- if (*msg->remember && type == E_PASSWORDS_REMEMBER_FOREVER)
|
|
|
|
- ep_remember_password_file(msg);
|
|
|
|
- ep_remember_password_file(msg);
|
|
|
|
-#endif
|
|
|
|
-#endif
|
|
|
|
+ /* Run the password dialog in the main thread. */
|
|
|
|
+ /* Wait for the user to respond. */
|
|
|
|
+ g_idle_add ((GSourceFunc) ep_dialog_run, msg);
|
|
|
|
+ e_flag_wait (data->done);
|
|
|
|
|
|
|
|
|
|
|
|
- msg->noreply = noreply;
|
|
|
|
- msg->noreply = noreply;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
+ /* If the user cancelled the dialog then we need to dispatch
|
|
|
|
+ /* Wait for the user to respond. */
|
|
|
|
+ * any messages that we trapped in the express queue. */
|
|
|
|
+ e_flag_wait (data->done);
|
|
|
|
+ if (data->response != GTK_RESPONSE_OK) {
|
|
|
|
|
|
|
|
+ g_async_queue_lock (express_queue);
|
|
|
|
|
|
|
|
+ express_key = NULL;
|
|
|
|
|
|
|
|
+ while ((msg = g_async_queue_try_pop_unlocked (express_queue)))
|
|
|
|
|
|
|
|
+ ep_msg_dispatch (msg);
|
|
|
|
|
|
|
|
+ g_async_queue_unlock (express_queue);
|
|
|
|
|
|
|
|
+ return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- gtk_widget_destroy((GtkWidget *)dialog);
|
|
|
|
- gtk_widget_destroy((GtkWidget *)dialog);
|
|
|
|
- password_dialog = NULL;
|
|
|
|
- password_dialog = NULL;
|
|
|
|
-
|
|
|
|
+ remember = data->flags & E_PASSWORDS_REMEMBER_MASK;
|
|
|
|
|
|
|
|
|
|
|
|
- /* ok, here things get interesting, we suck up any pending
|
|
|
|
- /* ok, here things get interesting, we suck up any pending
|
|
|
|
- * operations on this specific password, and return the same
|
|
|
|
- * operations on this specific password, and return the same
|
|
|
|
- * result or ignore other operations */
|
|
|
|
- * result or ignore other operations */
|
|
|
@ -1067,23 +1077,20 @@
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- mw = mn;
|
|
|
|
- mw = mn;
|
|
|
|
- mn = (EPassMsg *)mn->msg.ln.next;
|
|
|
|
- mn = (EPassMsg *)mn->msg.ln.next;
|
|
|
|
+ /* If the user cancelled the dialog then we need to dispatch
|
|
|
|
- }
|
|
|
|
+ * any messages that we trapped in the express queue. */
|
|
|
|
|
|
|
|
+ if (data->response != GTK_RESPONSE_OK) {
|
|
|
|
|
|
|
|
+ g_async_queue_lock (express_queue);
|
|
|
|
|
|
|
|
+ express_key = NULL;
|
|
|
|
|
|
|
|
+ while ((msg = g_async_queue_try_pop_unlocked (express_queue)))
|
|
|
|
|
|
|
|
+ ep_msg_dispatch (msg);
|
|
|
|
|
|
|
|
+ g_async_queue_unlock (express_queue);
|
|
|
|
|
|
|
|
+ return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
- UNLOCK();
|
|
|
|
- UNLOCK();
|
|
|
|
-
|
|
|
|
+ if (remember == E_PASSWORDS_REMEMBER_NEVER)
|
|
|
|
|
|
|
|
+ goto cleanup;
|
|
|
|
|
|
|
|
|
|
|
|
- if (!msg->noreply)
|
|
|
|
- if (!msg->noreply)
|
|
|
|
- e_msgport_reply(&msg->msg);
|
|
|
|
- e_msgport_reply(&msg->msg);
|
|
|
|
-
|
|
|
|
+ if (data->remember || remember == E_PASSWORDS_REMEMBER_FOREVER)
|
|
|
|
|
|
|
|
+ ep_add_password (msg);
|
|
|
|
|
|
|
|
|
|
|
|
- ep_idle_dispatch(NULL);
|
|
|
|
- ep_idle_dispatch(NULL);
|
|
|
|
-}
|
|
|
|
-}
|
|
|
|
|
|
|
|
+ if (data->remember && remember == E_PASSWORDS_REMEMBER_FOREVER)
|
|
|
|
|
|
|
|
+ ep_remember_password (msg);
|
|
|
|
|
|
|
|
|
|
|
|
-static void
|
|
|
|
-static void
|
|
|
|
-ep_ask_password(EPassMsg *msg)
|
|
|
|
-ep_ask_password(EPassMsg *msg)
|
|
|
@ -1092,12 +1099,9 @@
|
|
|
|
- int type = msg->flags & E_PASSWORDS_REMEMBER_MASK;
|
|
|
|
- int type = msg->flags & E_PASSWORDS_REMEMBER_MASK;
|
|
|
|
- guint noreply = msg->noreply;
|
|
|
|
- guint noreply = msg->noreply;
|
|
|
|
- AtkObject *a11y;
|
|
|
|
- AtkObject *a11y;
|
|
|
|
+ remember = data->flags & E_PASSWORDS_REMEMBER_MASK;
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
- msg->noreply = 1;
|
|
|
|
- msg->noreply = 1;
|
|
|
|
+ if (remember == E_PASSWORDS_REMEMBER_NEVER)
|
|
|
|
-
|
|
|
|
+ goto cleanup;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- /*password_dialog = (GtkDialog *)e_error_new(msg->parent, "mail:ask-session-password", msg->prompt, NULL);*/
|
|
|
|
- /*password_dialog = (GtkDialog *)e_error_new(msg->parent, "mail:ask-session-password", msg->prompt, NULL);*/
|
|
|
|
- password_dialog = (GtkDialog *)gtk_message_dialog_new (msg->parent,
|
|
|
|
- password_dialog = (GtkDialog *)gtk_message_dialog_new (msg->parent,
|
|
|
|
- 0,
|
|
|
|
- 0,
|
|
|
@ -1105,15 +1109,11 @@
|
|
|
|
- GTK_BUTTONS_OK_CANCEL,
|
|
|
|
- GTK_BUTTONS_OK_CANCEL,
|
|
|
|
- "%s", msg->prompt);
|
|
|
|
- "%s", msg->prompt);
|
|
|
|
- gtk_window_set_title(GTK_WINDOW(password_dialog), msg->title);
|
|
|
|
- gtk_window_set_title(GTK_WINDOW(password_dialog), msg->title);
|
|
|
|
+ if (data->remember || remember == E_PASSWORDS_REMEMBER_FOREVER)
|
|
|
|
-
|
|
|
|
+ ep_add_password (msg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- gtk_widget_ensure_style (GTK_WIDGET (password_dialog));
|
|
|
|
- gtk_widget_ensure_style (GTK_WIDGET (password_dialog));
|
|
|
|
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (password_dialog)->vbox), 0);
|
|
|
|
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (password_dialog)->vbox), 0);
|
|
|
|
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (password_dialog)->action_area), 12);
|
|
|
|
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (password_dialog)->action_area), 12);
|
|
|
|
+ if (data->remember && remember == E_PASSWORDS_REMEMBER_FOREVER)
|
|
|
|
-
|
|
|
|
+ ep_remember_password (msg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- gtk_dialog_set_default_response(password_dialog, GTK_RESPONSE_OK);
|
|
|
|
- gtk_dialog_set_default_response(password_dialog, GTK_RESPONSE_OK);
|
|
|
|
+cleanup:
|
|
|
|
+cleanup:
|
|
|
|
|
|
|
|
|
|
|
@ -1271,7 +1271,7 @@
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Set the offline-state of the application. This is a work-around
|
|
|
|
* Set the offline-state of the application. This is a work-around
|
|
|
|
* for having the backends fully offline aware, and returns a
|
|
|
|
* for having the backends fully offline aware, and returns a
|
|
|
|
@@ -920,10 +1007,11 @@ e_passwords_shutdown (void)
|
|
|
|
@@ -920,10 +1007,11 @@
|
|
|
|
* FIXME: This is not a permanent api, review post 2.0.
|
|
|
|
* FIXME: This is not a permanent api, review post 2.0.
|
|
|
|
**/
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
void
|
|
|
@ -1286,7 +1286,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@@ -934,151 +1022,138 @@ e_passwords_set_online(int state)
|
|
|
|
@@ -934,151 +1022,138 @@
|
|
|
|
void
|
|
|
|
void
|
|
|
|
e_passwords_forget_passwords (void)
|
|
|
|
e_passwords_forget_passwords (void)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1322,15 +1322,15 @@
|
|
|
|
- EPassMsg *msg = ep_msg_new(ep_clear_passwords_file);
|
|
|
|
- EPassMsg *msg = ep_msg_new(ep_clear_passwords_file);
|
|
|
|
-#endif
|
|
|
|
-#endif
|
|
|
|
+ EPassMsg *msg;
|
|
|
|
+ EPassMsg *msg;
|
|
|
|
+
|
|
|
|
|
|
|
|
+ g_return_if_fail (component != NULL);
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ msg = ep_msg_new (ep_clear_passwords, FALSE);
|
|
|
|
|
|
|
|
+ msg->component = component;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- msg->component = component_name;
|
|
|
|
- msg->component = component_name;
|
|
|
|
- ep_msg_send(msg);
|
|
|
|
- ep_msg_send(msg);
|
|
|
|
- ep_msg_free(msg);
|
|
|
|
- ep_msg_free(msg);
|
|
|
|
|
|
|
|
+ g_return_if_fail (component != NULL);
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ msg = ep_msg_new (ep_clear_passwords, FALSE);
|
|
|
|
|
|
|
|
+ msg->component = component;
|
|
|
|
|
|
|
|
+
|
|
|
|
+ ep_msg_send (msg);
|
|
|
|
+ ep_msg_send (msg);
|
|
|
|
+ ep_msg_free (msg);
|
|
|
|
+ ep_msg_free (msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1436,14 +1436,14 @@
|
|
|
|
msg->key = key;
|
|
|
|
msg->key = key;
|
|
|
|
|
|
|
|
|
|
|
|
- ep_msg_send(msg);
|
|
|
|
- ep_msg_send(msg);
|
|
|
|
-
|
|
|
|
|
|
|
|
- passwd = msg->password;
|
|
|
|
|
|
|
|
- msg->password = NULL;
|
|
|
|
|
|
|
|
- ep_msg_free(msg);
|
|
|
|
|
|
|
|
+ ep_msg_send (msg);
|
|
|
|
+ ep_msg_send (msg);
|
|
|
|
+ password = msg->password;
|
|
|
|
+ password = msg->password;
|
|
|
|
+ ep_msg_free (msg);
|
|
|
|
+ ep_msg_free (msg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- passwd = msg->password;
|
|
|
|
|
|
|
|
- msg->password = NULL;
|
|
|
|
|
|
|
|
- ep_msg_free(msg);
|
|
|
|
|
|
|
|
-
|
|
|
|
- return passwd;
|
|
|
|
- return passwd;
|
|
|
|
+ return password;
|
|
|
|
+ return password;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1492,7 +1492,7 @@
|
|
|
|
* @prompt: prompt string
|
|
|
|
* @prompt: prompt string
|
|
|
|
* @type: whether or not to offer to remember the password,
|
|
|
|
* @type: whether or not to offer to remember the password,
|
|
|
|
* and for how long.
|
|
|
|
* and for how long.
|
|
|
|
@@ -1093,241 +1168,44 @@ e_passwords_add_password (const char *ke
|
|
|
|
@@ -1093,245 +1168,44 @@
|
|
|
|
* return value is non-%NULL and @remember_type is not
|
|
|
|
* return value is non-%NULL and @remember_type is not
|
|
|
|
* E_PASSWORDS_DO_NOT_REMEMBER.
|
|
|
|
* E_PASSWORDS_DO_NOT_REMEMBER.
|
|
|
|
**/
|
|
|
|
**/
|
|
|
@ -1511,8 +1511,10 @@
|
|
|
|
GtkWindow *parent)
|
|
|
|
GtkWindow *parent)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
- char *passwd;
|
|
|
|
- char *passwd;
|
|
|
|
- EPassMsg *msg = ep_msg_new(ep_ask_password);
|
|
|
|
EPassMsg *msg;
|
|
|
|
+ EPassMsg *msg;
|
|
|
|
-
|
|
|
|
|
|
|
|
- g_return_val_if_fail (component_name != NULL, NULL);
|
|
|
|
|
|
|
|
- g_return_val_if_fail (key != NULL, NULL);
|
|
|
|
+ EPassDialogData *data;
|
|
|
|
+ EPassDialogData *data;
|
|
|
|
+ gboolean remember;
|
|
|
|
+ gboolean remember;
|
|
|
|
+ gchar *password;
|
|
|
|
+ gchar *password;
|
|
|
@ -1524,6 +1526,7 @@
|
|
|
|
if ((type & E_PASSWORDS_ONLINE) && !ep_online_state)
|
|
|
|
if ((type & E_PASSWORDS_ONLINE) && !ep_online_state)
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- msg = ep_msg_new (ep_ask_password);
|
|
|
|
- msg->title = title;
|
|
|
|
- msg->title = title;
|
|
|
|
- msg->component = component_name;
|
|
|
|
- msg->component = component_name;
|
|
|
|
- msg->key = key;
|
|
|
|
- msg->key = key;
|
|
|
@ -1762,8 +1765,8 @@
|
|
|
|
- return (char *)plain;
|
|
|
|
- return (char *)plain;
|
|
|
|
+ return password;
|
|
|
|
+ return password;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--- evolution-data-server-1.11.91/libedataserverui/e-passwords.h.e-passwords 2007-07-05 08:01:52.000000000 +0200
|
|
|
|
--- evolution-data-server-1.11.92/libedataserverui/e-passwords.h.e-passwords 2007-09-02 14:54:22.000000000 -0400
|
|
|
|
+++ evolution-data-server-1.11.91/libedataserverui/e-passwords.h 2007-08-28 15:32:45.000000000 +0200
|
|
|
|
+++ evolution-data-server-1.11.92/libedataserverui/e-passwords.h 2007-09-03 23:13:10.000000000 -0400
|
|
|
|
@@ -28,45 +28,65 @@
|
|
|
|
@@ -28,45 +28,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
G_BEGIN_DECLS
|
|
|
@ -1861,9 +1864,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
|
|
|
|
--- evolution-data-server-1.11.91/libedataserver/e-msgport.h.e-passwords 2007-07-05 08:01:55.000000000 +0200
|
|
|
|
--- evolution-data-server-1.11.92/libedataserver/e-msgport.h.e-passwords 2007-07-05 02:01:55.000000000 -0400
|
|
|
|
+++ evolution-data-server-1.11.91/libedataserver/e-msgport.h 2007-08-28 15:18:31.000000000 +0200
|
|
|
|
+++ evolution-data-server-1.11.92/libedataserver/e-msgport.h 2007-09-03 23:13:10.000000000 -0400
|
|
|
|
@@ -54,7 +54,7 @@ typedef struct _EMsgPort EMsgPort;
|
|
|
|
@@ -54,7 +54,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
/* header for any message */
|
|
|
|
/* header for any message */
|
|
|
|
typedef struct _EMsg {
|
|
|
|
typedef struct _EMsg {
|
|
|
|