|
|
@ -1,5 +1,5 @@
|
|
|
|
--- evolution-data-server-1.11.2/libedataserverui/e-passwords.h.e-passwords 2007-04-18 06:10:16.000000000 -0400
|
|
|
|
--- evolution-data-server-1.11.4/libedataserverui/e-passwords.h.e-passwords 2007-04-18 06:10:16.000000000 -0400
|
|
|
|
+++ evolution-data-server-1.11.2/libedataserverui/e-passwords.h 2007-05-31 22:51:17.000000000 -0400
|
|
|
|
+++ evolution-data-server-1.11.4/libedataserverui/e-passwords.h 2007-06-18 16:19:44.000000000 -0400
|
|
|
|
@@ -28,45 +28,65 @@
|
|
|
|
@@ -28,45 +28,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
G_BEGIN_DECLS
|
|
|
@ -97,8 +97,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
|
|
|
|
--- evolution-data-server-1.11.2/libedataserverui/e-passwords.c.e-passwords 2007-04-18 06:10:16.000000000 -0400
|
|
|
|
--- evolution-data-server-1.11.4/libedataserverui/e-passwords.c.e-passwords 2007-06-17 23:25:35.000000000 -0400
|
|
|
|
+++ evolution-data-server-1.11.2/libedataserverui/e-passwords.c 2007-05-31 23:55:51.000000000 -0400
|
|
|
|
+++ evolution-data-server-1.11.4/libedataserverui/e-passwords.c 2007-06-18 16:26:02.000000000 -0400
|
|
|
|
@@ -23,18 +23,29 @@
|
|
|
|
@@ -23,18 +23,29 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
@ -269,16 +269,17 @@
|
|
|
|
+ * fully migrate to GNOME Keyring or whatever software supercedes it.
|
|
|
|
+ * fully migrate to GNOME Keyring or whatever software supercedes it.
|
|
|
|
+ * Evolution is one of the few remaining GNOME-2 applications that
|
|
|
|
+ * Evolution is one of the few remaining GNOME-2 applications that
|
|
|
|
+ * still uses the deprecated ~/.gnome2-private directory. */
|
|
|
|
+ * still uses the deprecated ~/.gnome2-private directory. */
|
|
|
|
+
|
|
|
|
|
|
|
|
+ return g_build_filename (g_get_home_dir (),
|
|
|
|
|
|
|
|
+ ".gnome2_private", "Evolution", NULL);
|
|
|
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- /* As soon as a password window is up we stop; it will
|
|
|
|
- /* As soon as a password window is up we stop; it will
|
|
|
|
- re-invoke us when it has been closed down */
|
|
|
|
- re-invoke us when it has been closed down */
|
|
|
|
- LOCK();
|
|
|
|
- LOCK();
|
|
|
|
- while (password_dialog == NULL && (msg = (EPassMsg *)e_dlist_remhead(&request_list))) {
|
|
|
|
- while (password_dialog == NULL && (msg = (EPassMsg *)e_dlist_remhead(&request_list))) {
|
|
|
|
- UNLOCK();
|
|
|
|
- UNLOCK();
|
|
|
|
|
|
|
|
+ return g_build_filename (g_get_home_dir (),
|
|
|
|
|
|
|
|
+ ".gnome2_private", "Evolution", NULL);
|
|
|
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- msg->dispatch(msg);
|
|
|
|
+static gchar *
|
|
|
|
+static gchar *
|
|
|
|
+ep_key_file_get_group (const gchar *component)
|
|
|
|
+ep_key_file_get_group (const gchar *component)
|
|
|
|
+{
|
|
|
|
+{
|
|
|
@ -295,8 +296,7 @@
|
|
|
|
+ * continue to do the same for backward-compatibility. */
|
|
|
|
+ * continue to do the same for backward-compatibility. */
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ gchar *normalized_key, *cp;
|
|
|
|
+ gchar *normalized_key, *cp;
|
|
|
|
|
|
|
|
+
|
|
|
|
- msg->dispatch(msg);
|
|
|
|
|
|
|
|
+ normalized_key = g_strdup (key);
|
|
|
|
+ normalized_key = g_strdup (key);
|
|
|
|
+ for (cp = normalized_key; *cp != '\0'; cp++)
|
|
|
|
+ for (cp = normalized_key; *cp != '\0'; cp++)
|
|
|
|
+ if (*cp == '/' || *cp == '=')
|
|
|
|
+ if (*cp == '/' || *cp == '=')
|
|
|
@ -310,10 +310,10 @@
|
|
|
|
+{
|
|
|
|
+{
|
|
|
|
+ gchar *filename;
|
|
|
|
+ gchar *filename;
|
|
|
|
+ GError *error = NULL;
|
|
|
|
+ GError *error = NULL;
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ filename = ep_key_file_get_filename ();
|
|
|
|
|
|
|
|
|
|
|
|
- LOCK();
|
|
|
|
- LOCK();
|
|
|
|
+ filename = ep_key_file_get_filename ();
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ if (!g_file_test (filename, G_FILE_TEST_EXISTS))
|
|
|
|
+ if (!g_file_test (filename, G_FILE_TEST_EXISTS))
|
|
|
|
+ goto exit;
|
|
|
|
+ goto exit;
|
|
|
|
+
|
|
|
|
+
|
|
|
@ -379,17 +379,11 @@
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ gchar *password;
|
|
|
|
+ gchar *password;
|
|
|
|
+ gsize length;
|
|
|
|
+ gsize length;
|
|
|
|
|
|
|
|
+
|
|
|
|
- e_passwords_init();
|
|
|
|
|
|
|
|
+ password = (gchar *) g_base64_decode (encoded_password, &length);
|
|
|
|
+ password = (gchar *) g_base64_decode (encoded_password, &length);
|
|
|
|
+ password = g_realloc (password, length + 1);
|
|
|
|
+ password = g_realloc (password, length + 1);
|
|
|
|
+ password[length] = '\0';
|
|
|
|
+ password[length] = '\0';
|
|
|
|
|
|
|
|
+
|
|
|
|
- msg = g_malloc0(sizeof(*msg));
|
|
|
|
|
|
|
|
- msg->dispatch = dispatch;
|
|
|
|
|
|
|
|
- msg->msg.reply_port = e_msgport_new();
|
|
|
|
|
|
|
|
-#ifdef ENABLE_THREADS
|
|
|
|
|
|
|
|
- msg->ismain = pthread_equal(pthread_self(), main_thread);
|
|
|
|
|
|
|
|
+ return password;
|
|
|
|
+ return password;
|
|
|
|
+}
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
@ -403,9 +397,15 @@
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ password_cache = g_hash_table_new_full (
|
|
|
|
+ password_cache = g_hash_table_new_full (
|
|
|
|
+ g_str_hash, g_str_equal, g_free, g_free);
|
|
|
|
+ g_str_hash, g_str_equal, g_free, g_free);
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
- e_passwords_init();
|
|
|
|
+ express_queue = g_async_queue_new ();
|
|
|
|
+ express_queue = g_async_queue_new ();
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
- msg = g_malloc0(sizeof(*msg));
|
|
|
|
|
|
|
|
- msg->dispatch = dispatch;
|
|
|
|
|
|
|
|
- msg->msg.reply_port = e_msgport_new();
|
|
|
|
|
|
|
|
-#ifdef ENABLE_THREADS
|
|
|
|
|
|
|
|
- msg->ismain = pthread_equal(pthread_self(), main_thread);
|
|
|
|
+#ifdef WITH_GNOME_KEYRING
|
|
|
|
+#ifdef WITH_GNOME_KEYRING
|
|
|
|
+ if (!gnome_keyring_is_available ()) {
|
|
|
|
+ if (!gnome_keyring_is_available ()) {
|
|
|
|
+ key_file = g_key_file_new ();
|
|
|
|
+ key_file = g_key_file_new ();
|
|
|
@ -486,7 +486,8 @@
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
-ep_msg_send(EPassMsg *msg)
|
|
|
|
-ep_msg_send(EPassMsg *msg)
|
|
|
|
+ep_msg_free (EPassMsg *msg)
|
|
|
|
+ep_msg_free (EPassMsg *msg)
|
|
|
|
+{
|
|
|
|
{
|
|
|
|
|
|
|
|
- int needidle = 0;
|
|
|
|
+ e_flag_free (msg->done);
|
|
|
|
+ e_flag_free (msg->done);
|
|
|
|
+ g_slice_free (EPassMsg, msg);
|
|
|
|
+ g_slice_free (EPassMsg, msg);
|
|
|
|
+}
|
|
|
|
+}
|
|
|
@ -515,18 +516,17 @@
|
|
|
|
+ e_flag_free (data->done);
|
|
|
|
+ e_flag_free (data->done);
|
|
|
|
+ g_slice_free (EPassDialogData, data);
|
|
|
|
+ g_slice_free (EPassDialogData, data);
|
|
|
|
+}
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
|
|
+static gboolean
|
|
|
|
|
|
|
|
+ep_dialog_run (EPassMsg *msg)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
- int needidle = 0;
|
|
|
|
|
|
|
|
+ /* This function must run in the main thread. */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- LOCK();
|
|
|
|
- LOCK();
|
|
|
|
- e_dlist_addtail(&request_list, (EDListNode *)&msg->msg);
|
|
|
|
- e_dlist_addtail(&request_list, (EDListNode *)&msg->msg);
|
|
|
|
- if (!idle_id) {
|
|
|
|
- if (!idle_id) {
|
|
|
|
- if (!msg->ismain)
|
|
|
|
- if (!msg->ismain)
|
|
|
|
- idle_id = g_idle_add(ep_idle_dispatch, NULL);
|
|
|
|
- idle_id = g_idle_add(ep_idle_dispatch, NULL);
|
|
|
|
|
|
|
|
+static gboolean
|
|
|
|
|
|
|
|
+ep_dialog_run (EPassMsg *msg)
|
|
|
|
|
|
|
|
+{
|
|
|
|
|
|
|
|
+ /* This function must run in the main thread. */
|
|
|
|
|
|
|
|
+
|
|
|
|
+ EPassDialogData *data = msg->data;
|
|
|
|
+ EPassDialogData *data = msg->data;
|
|
|
|
+ GtkBox *box;
|
|
|
|
+ GtkBox *box;
|
|
|
|
+ GtkWidget *dialog;
|
|
|
|
+ GtkWidget *dialog;
|
|
|
@ -651,15 +651,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;
|
|
|
|
|
|
|
|
|
|
|
|
- path = g_strdup_printf ("/Evolution/Passwords-%s", msg->component);
|
|
|
|
|
|
|
|
+ group = ep_key_file_get_group (msg->component);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- gnome_config_private_clean_section (path);
|
|
|
|
- gnome_config_private_clean_section (path);
|
|
|
|
- gnome_config_private_sync_file ("/Evolution");
|
|
|
|
- gnome_config_private_sync_file ("/Evolution");
|
|
|
|
-
|
|
|
|
+ group = ep_key_file_get_group (msg->component);
|
|
|
|
|
|
|
|
|
|
|
|
- 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)
|
|
|
@ -835,11 +835,16 @@
|
|
|
|
- gpointer okey, value;
|
|
|
|
- gpointer okey, value;
|
|
|
|
- char *path, *pass64;
|
|
|
|
- char *path, *pass64;
|
|
|
|
- int len, state, save;
|
|
|
|
- int len, state, save;
|
|
|
|
-
|
|
|
|
+ gchar *group, *key, *password;
|
|
|
|
|
|
|
|
|
|
|
|
- if (g_hash_table_lookup_extended (passwords, msg->key, &okey, &value)) {
|
|
|
|
- if (g_hash_table_lookup_extended (passwords, msg->key, &okey, &value)) {
|
|
|
|
- /* add it to the on-disk cache of passwords */
|
|
|
|
- /* add it to the on-disk cache of passwords */
|
|
|
|
- path = password_path (msg->component, okey);
|
|
|
|
- path = password_path (msg->component, okey);
|
|
|
|
+ gchar *group, *key, *password;
|
|
|
|
+ password = g_hash_table_lookup (password_cache, msg->key);
|
|
|
|
|
|
|
|
+ if (password == NULL) {
|
|
|
|
|
|
|
|
+ g_warning ("Password for key \"%s\" not found", msg->key);
|
|
|
|
|
|
|
|
+ return;
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
- len = strlen (value);
|
|
|
|
- len = strlen (value);
|
|
|
|
- pass64 = g_malloc0 ((len + 2) * 4 / 3 + 1);
|
|
|
|
- pass64 = g_malloc0 ((len + 2) * 4 / 3 + 1);
|
|
|
@ -849,20 +854,14 @@
|
|
|
|
- gnome_config_private_set_string (path, pass64);
|
|
|
|
- gnome_config_private_set_string (path, pass64);
|
|
|
|
- g_free (path);
|
|
|
|
- g_free (path);
|
|
|
|
- g_free (pass64);
|
|
|
|
- g_free (pass64);
|
|
|
|
+ password = g_hash_table_lookup (password_cache, msg->key);
|
|
|
|
+ group = ep_key_file_get_group (msg->component);
|
|
|
|
+ if (password == NULL) {
|
|
|
|
+ key = ep_key_file_normalize_key (msg->key);
|
|
|
|
+ g_warning ("Password for key \"%s\" not found", msg->key);
|
|
|
|
+ password = ep_password_encode (password);
|
|
|
|
+ return;
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- /* now remove it from our session hash */
|
|
|
|
- /* now remove it from our session hash */
|
|
|
|
- g_hash_table_remove (passwords, msg->key);
|
|
|
|
- g_hash_table_remove (passwords, msg->key);
|
|
|
|
- g_free (okey);
|
|
|
|
- g_free (okey);
|
|
|
|
- g_free (value);
|
|
|
|
- g_free (value);
|
|
|
|
+ group = ep_key_file_get_group (msg->component);
|
|
|
|
|
|
|
|
+ key = ep_key_file_normalize_key (msg->key);
|
|
|
|
|
|
|
|
+ password = ep_password_encode (password);
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ g_hash_table_remove (password_cache, msg->key);
|
|
|
|
+ g_hash_table_remove (password_cache, msg->key);
|
|
|
|
+ g_key_file_set_string (key_file, group, key, password);
|
|
|
|
+ g_key_file_set_string (key_file, group, key, password);
|
|
|
|
+ ep_key_file_save ();
|
|
|
|
+ ep_key_file_save ();
|
|
|
@ -898,7 +897,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) {
|
|
|
|
@@ -486,27 +703,17 @@ ep_forget_password_keyring (EPassMsg *ms
|
|
|
|
@@ -486,12 +703,7 @@ ep_forget_password_keyring (EPassMsg *ms
|
|
|
|
uri->user = keycopy;
|
|
|
|
uri->user = keycopy;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -910,32 +909,16 @@
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
+ g_hash_table_remove (password_cache, msg->key);
|
|
|
|
+ g_hash_table_remove (password_cache, msg->key);
|
|
|
|
|
|
|
|
|
|
|
|
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 */
|
|
|
|
- if (!msg->noreply)
|
|
|
|
@@ -563,36 +775,45 @@ ep_forget_password_keyring (EPassMsg *ms
|
|
|
|
- e_msgport_reply(&msg->msg);
|
|
|
|
g_free (default_keyring);
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result = gnome_keyring_get_default_keyring_sync (&default_keyring);
|
|
|
|
exit:
|
|
|
|
if (!default_keyring) {
|
|
|
|
|
|
|
|
- if (gnome_keyring_create_sync ("default", NULL) != GNOME_KEYRING_RESULT_OK) {
|
|
|
|
|
|
|
|
- if (!msg->noreply)
|
|
|
|
- if (!msg->noreply)
|
|
|
|
- e_msgport_reply(&msg->msg);
|
|
|
|
- e_msgport_reply(&msg->msg);
|
|
|
|
- return;
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
+ if (gnome_keyring_create_sync ("default", NULL) != GNOME_KEYRING_RESULT_OK)
|
|
|
|
|
|
|
|
+ return;
|
|
|
|
|
|
|
|
default_keyring = g_strdup ("default");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -567,35 +774,44 @@ ep_forget_password_keyring (EPassMsg *ms
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_free (default_keyring);
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if (!msg->noreply)
|
|
|
|
e_uri_free(uri);
|
|
|
|
- e_msgport_reply(&msg->msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
@ -947,17 +930,17 @@
|
|
|
|
- char *path;
|
|
|
|
- char *path;
|
|
|
|
+ gchar *group, *key;
|
|
|
|
+ gchar *group, *key;
|
|
|
|
+ GError *error = NULL;
|
|
|
|
+ GError *error = NULL;
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ g_hash_table_remove (password_cache, msg->key);
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ group = ep_key_file_get_group (msg->component);
|
|
|
|
|
|
|
|
+ key = ep_key_file_normalize_key (msg->key);
|
|
|
|
|
|
|
|
|
|
|
|
- if (g_hash_table_lookup_extended (passwords, msg->key, &okey, &value)) {
|
|
|
|
- if (g_hash_table_lookup_extended (passwords, msg->key, &okey, &value)) {
|
|
|
|
- g_hash_table_remove (passwords, msg->key);
|
|
|
|
- g_hash_table_remove (passwords, msg->key);
|
|
|
|
- memset (value, 0, strlen (value));
|
|
|
|
- memset (value, 0, strlen (value));
|
|
|
|
- g_free (okey);
|
|
|
|
- g_free (okey);
|
|
|
|
- g_free (value);
|
|
|
|
- g_free (value);
|
|
|
|
+ g_hash_table_remove (password_cache, msg->key);
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ group = ep_key_file_get_group (msg->component);
|
|
|
|
|
|
|
|
+ key = ep_key_file_normalize_key (msg->key);
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ g_key_file_remove_key (key_file, group, key, &error);
|
|
|
|
+ g_key_file_remove_key (key_file, group, key, &error);
|
|
|
|
+ if (error == NULL)
|
|
|
|
+ if (error == NULL)
|
|
|
|
+ ep_key_file_save ();
|
|
|
|
+ ep_key_file_save ();
|
|
|
@ -993,7 +976,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef WITH_GNOME_KEYRING
|
|
|
|
#ifdef WITH_GNOME_KEYRING
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
@@ -605,11 +821,11 @@ ep_get_password_keyring (EPassMsg *msg)
|
|
|
|
@@ -602,11 +823,11 @@ ep_get_password_keyring (EPassMsg *msg)
|
|
|
|
GnomeKeyringAttributeList *attributes;
|
|
|
|
GnomeKeyringAttributeList *attributes;
|
|
|
|
GnomeKeyringAttribute attribute;
|
|
|
|
GnomeKeyringAttribute attribute;
|
|
|
|
GnomeKeyringResult result;
|
|
|
|
GnomeKeyringResult result;
|
|
|
@ -1008,9 +991,9 @@
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
EUri *uri = e_uri_new (msg->key);
|
|
|
|
EUri *uri = e_uri_new (msg->key);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -683,284 +899,154 @@ ep_get_password_keyring (EPassMsg *msg)
|
|
|
|
@@ -681,284 +902,154 @@ ep_get_password_keyring (EPassMsg *msg)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
e_uri_free (uri);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if (!msg->noreply)
|
|
|
|
- if (!msg->noreply)
|
|
|
@ -1030,7 +1013,20 @@
|
|
|
|
- passwd = g_hash_table_lookup (passwords, msg->key);
|
|
|
|
- passwd = g_hash_table_lookup (passwords, msg->key);
|
|
|
|
- if (passwd) {
|
|
|
|
- if (passwd) {
|
|
|
|
- msg->password = g_strdup(passwd);
|
|
|
|
- msg->password = g_strdup(passwd);
|
|
|
|
- } else {
|
|
|
|
+ password = g_hash_table_lookup (password_cache, msg->key);
|
|
|
|
|
|
|
|
+ if (password != NULL) {
|
|
|
|
|
|
|
|
+ msg->password = g_strdup (password);
|
|
|
|
|
|
|
|
+ return;
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ group = ep_key_file_get_group (msg->component);
|
|
|
|
|
|
|
|
+ key = ep_key_file_normalize_key (msg->key);
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ password = g_key_file_get_string (key_file, group, key, &error);
|
|
|
|
|
|
|
|
+ if (password != NULL) {
|
|
|
|
|
|
|
|
+ msg->password = ep_password_decode (password);
|
|
|
|
|
|
|
|
+ g_free (password);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
- /* not part of the session hash, look it up in the on disk db */
|
|
|
|
- /* not part of the session hash, look it up in the on disk db */
|
|
|
|
- path = password_path (msg->component, msg->key);
|
|
|
|
- path = password_path (msg->component, msg->key);
|
|
|
|
- encoded = gnome_config_private_get_string_with_default (path, NULL);
|
|
|
|
- encoded = gnome_config_private_get_string_with_default (path, NULL);
|
|
|
@ -1039,49 +1035,47 @@
|
|
|
|
- msg->password = decode_base64 (encoded);
|
|
|
|
- msg->password = decode_base64 (encoded);
|
|
|
|
- g_free (encoded);
|
|
|
|
- g_free (encoded);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
+ password = g_hash_table_lookup (password_cache, msg->key);
|
|
|
|
+ g_warning ("%s", error->message);
|
|
|
|
+ if (password != NULL) {
|
|
|
|
+ g_error_free (error);
|
|
|
|
+ msg->password = g_strdup (password);
|
|
|
|
|
|
|
|
+ return;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- if (!msg->noreply)
|
|
|
|
- if (!msg->noreply)
|
|
|
|
- e_msgport_reply(&msg->msg);
|
|
|
|
- e_msgport_reply(&msg->msg);
|
|
|
|
-}
|
|
|
|
+ g_free (group);
|
|
|
|
+ group = ep_key_file_get_group (msg->component);
|
|
|
|
+ g_free (key);
|
|
|
|
+ key = ep_key_file_normalize_key (msg->key);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-static void
|
|
|
|
static void
|
|
|
|
-ep_add_password (EPassMsg *msg)
|
|
|
|
-ep_add_password (EPassMsg *msg)
|
|
|
|
-{
|
|
|
|
+ep_get_password (EPassMsg *msg)
|
|
|
|
|
|
|
|
{
|
|
|
|
- gpointer okey, value;
|
|
|
|
- gpointer okey, value;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if (g_hash_table_lookup_extended (passwords, msg->key, &okey, &value)) {
|
|
|
|
- if (g_hash_table_lookup_extended (passwords, msg->key, &okey, &value)) {
|
|
|
|
- g_hash_table_remove (passwords, msg->key);
|
|
|
|
- g_hash_table_remove (passwords, msg->key);
|
|
|
|
- g_free (okey);
|
|
|
|
- g_free (okey);
|
|
|
|
- g_free (value);
|
|
|
|
- g_free (value);
|
|
|
|
+ password = g_key_file_get_string (key_file, group, key, &error);
|
|
|
|
- }
|
|
|
|
+ if (password != NULL) {
|
|
|
|
-
|
|
|
|
+ msg->password = ep_password_decode (password);
|
|
|
|
|
|
|
|
+ g_free (password);
|
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
|
|
|
+ g_warning ("%s", error->message);
|
|
|
|
|
|
|
|
+ g_error_free (error);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- g_hash_table_insert (passwords, g_strdup (msg->key), g_strdup (msg->oldpass));
|
|
|
|
- g_hash_table_insert (passwords, g_strdup (msg->key), g_strdup (msg->oldpass));
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if (!msg->noreply)
|
|
|
|
- if (!msg->noreply)
|
|
|
|
- e_msgport_reply(&msg->msg);
|
|
|
|
- e_msgport_reply(&msg->msg);
|
|
|
|
+ g_free (group);
|
|
|
|
+#ifdef WITH_GNOME_KEYRING
|
|
|
|
+ g_free (key);
|
|
|
|
+ if (gnome_keyring_is_available ())
|
|
|
|
|
|
|
|
+ ep_get_password_keyring (msg);
|
|
|
|
|
|
|
|
+ else
|
|
|
|
|
|
|
|
+ ep_get_password_keyfile (msg);
|
|
|
|
|
|
|
|
+#else
|
|
|
|
|
|
|
|
+ ep_get_password_keyfile (msg);
|
|
|
|
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-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_get_password (EPassMsg *msg)
|
|
|
|
+ep_add_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;
|
|
|
@ -1090,41 +1084,60 @@
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if (response == GTK_RESPONSE_OK) {
|
|
|
|
- if (response == GTK_RESPONSE_OK) {
|
|
|
|
- msg->password = g_strdup(gtk_entry_get_text((GtkEntry *)msg->entry));
|
|
|
|
- msg->password = g_strdup(gtk_entry_get_text((GtkEntry *)msg->entry));
|
|
|
|
-
|
|
|
|
+ gchar *key = g_strdup (msg->key);
|
|
|
|
|
|
|
|
+ gchar *password = g_strdup (msg->password);
|
|
|
|
|
|
|
|
|
|
|
|
- if (type != E_PASSWORDS_REMEMBER_NEVER) {
|
|
|
|
- if (type != E_PASSWORDS_REMEMBER_NEVER) {
|
|
|
|
- int noreply = msg->noreply;
|
|
|
|
- int noreply = msg->noreply;
|
|
|
|
-
|
|
|
|
+ g_hash_table_insert (password_cache, key, password);
|
|
|
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
|
- *msg->remember = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (msg->check));
|
|
|
|
- *msg->remember = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (msg->check));
|
|
|
|
-
|
|
|
|
+static void
|
|
|
|
|
|
|
|
+ep_ask_password (EPassMsg *msg)
|
|
|
|
|
|
|
|
+{
|
|
|
|
|
|
|
|
+ EPassDialogData *data = msg->data;
|
|
|
|
|
|
|
|
+ gchar *password;
|
|
|
|
|
|
|
|
+ gint remember;
|
|
|
|
|
|
|
|
|
|
|
|
- msg->noreply = 1;
|
|
|
|
- msg->noreply = 1;
|
|
|
|
-
|
|
|
|
+ /* Open the express queue for this key. This allows us to catch
|
|
|
|
|
|
|
|
+ * incoming operations on this key while waiting for the user to
|
|
|
|
|
|
|
|
+ * provide a password. Once we have the password, immediately
|
|
|
|
|
|
|
|
+ * process any messages in the express queue. */
|
|
|
|
|
|
|
|
+ g_async_queue_lock (express_queue);
|
|
|
|
|
|
|
|
+ express_key = msg->key;
|
|
|
|
|
|
|
|
+ g_async_queue_unlock (express_queue);
|
|
|
|
|
|
|
|
|
|
|
|
- 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);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
#ifdef WITH_GNOME_KEYRING
|
|
|
|
-#ifdef WITH_GNOME_KEYRING
|
|
|
|
- if (*msg->remember && type == E_PASSWORDS_REMEMBER_FOREVER) {
|
|
|
|
- if (*msg->remember && type == E_PASSWORDS_REMEMBER_FOREVER) {
|
|
|
|
- if (gnome_keyring_is_available())
|
|
|
|
- if (gnome_keyring_is_available())
|
|
|
|
- ep_remember_password_keyring(msg);
|
|
|
|
- ep_remember_password_keyring(msg);
|
|
|
|
- else
|
|
|
|
- else
|
|
|
|
- ep_remember_password_file(msg);
|
|
|
|
- ep_remember_password_file(msg);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
+ if (gnome_keyring_is_available ())
|
|
|
|
-#else
|
|
|
|
+ ep_get_password_keyring (msg);
|
|
|
|
|
|
|
|
+ else
|
|
|
|
|
|
|
|
+ ep_get_password_keyfile (msg);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
- 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
|
|
|
|
-
|
|
|
|
+ if (data->flags & E_PASSWORDS_REPROMPT)
|
|
|
|
|
|
|
|
+ ep_get_password (msg);
|
|
|
|
|
|
|
|
|
|
|
|
- msg->noreply = noreply;
|
|
|
|
- msg->noreply = noreply;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
+ /* Run the password dialog in the main thread. */
|
|
|
|
|
|
|
|
+ g_idle_add ((GSourceFunc) ep_dialog_run, msg);
|
|
|
|
|
|
|
|
|
|
|
|
- gtk_widget_destroy((GtkWidget *)dialog);
|
|
|
|
- gtk_widget_destroy((GtkWidget *)dialog);
|
|
|
|
- password_dialog = NULL;
|
|
|
|
- password_dialog = NULL;
|
|
|
|
-
|
|
|
|
+ /* Wait for the user to respond. */
|
|
|
|
|
|
|
|
+ e_flag_wait (data->done);
|
|
|
|
|
|
|
|
|
|
|
|
- /* 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 */
|
|
|
@ -1137,8 +1150,7 @@
|
|
|
|
- if ((mw->dispatch == (gnome_keyring_is_available() ? ep_forget_password_keyring : ep_forget_password_file)
|
|
|
|
- if ((mw->dispatch == (gnome_keyring_is_available() ? ep_forget_password_keyring : ep_forget_password_file)
|
|
|
|
-#else
|
|
|
|
-#else
|
|
|
|
- if ((mw->dispatch == ep_forget_password_file
|
|
|
|
- if ((mw->dispatch == ep_forget_password_file
|
|
|
|
+ ep_get_password_keyfile (msg);
|
|
|
|
-#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
-#ifdef WITH_GNOME_KEYRING
|
|
|
|
-#ifdef WITH_GNOME_KEYRING
|
|
|
|
- || mw->dispatch == (gnome_keyring_is_available() ? ep_get_password_keyring : ep_get_password_file)
|
|
|
|
- || mw->dispatch == (gnome_keyring_is_available() ? ep_get_password_keyring : ep_get_password_file)
|
|
|
|
-#else
|
|
|
|
-#else
|
|
|
@ -1153,64 +1165,36 @@
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- 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 (!msg->noreply)
|
|
|
|
- if (!msg->noreply)
|
|
|
|
- e_msgport_reply(&msg->msg);
|
|
|
|
- e_msgport_reply(&msg->msg);
|
|
|
|
+static void
|
|
|
|
|
|
|
|
+ep_add_password (EPassMsg *msg)
|
|
|
|
|
|
|
|
+{
|
|
|
|
|
|
|
|
+ gchar *key = g_strdup (msg->key);
|
|
|
|
|
|
|
|
+ gchar *password = g_strdup (msg->password);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- ep_idle_dispatch(NULL);
|
|
|
|
- ep_idle_dispatch(NULL);
|
|
|
|
+ g_hash_table_insert (password_cache, key, password);
|
|
|
|
-}
|
|
|
|
}
|
|
|
|
-
|
|
|
|
|
|
|
|
-static void
|
|
|
|
static void
|
|
|
|
|
|
|
|
-ep_ask_password(EPassMsg *msg)
|
|
|
|
-ep_ask_password(EPassMsg *msg)
|
|
|
|
+ep_ask_password (EPassMsg *msg)
|
|
|
|
-{
|
|
|
|
{
|
|
|
|
|
|
|
|
- GtkWidget *vbox;
|
|
|
|
- GtkWidget *vbox;
|
|
|
|
- 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;
|
|
|
|
+ EPassDialogData *data = msg->data;
|
|
|
|
+ remember = data->flags & E_PASSWORDS_REMEMBER_MASK;
|
|
|
|
+ gchar *password;
|
|
|
|
|
|
|
|
+ gint remember;
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ /* Open the express queue for this key. This allows us to catch
|
|
|
|
|
|
|
|
+ * incoming operations on this key while waiting for the user to
|
|
|
|
|
|
|
|
+ * provide a password. Once we have the password, immediately
|
|
|
|
|
|
|
|
+ * process any messages in the express queue. */
|
|
|
|
|
|
|
|
+ g_async_queue_lock (express_queue);
|
|
|
|
|
|
|
|
+ express_key = msg->key;
|
|
|
|
|
|
|
|
+ g_async_queue_unlock (express_queue);
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ if (data->flags & E_PASSWORDS_REPROMPT)
|
|
|
|
|
|
|
|
+ ep_get_password (msg);
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ /* Run the password dialog in the main thread. */
|
|
|
|
|
|
|
|
+ g_idle_add ((GSourceFunc) ep_dialog_run, msg);
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ /* Wait for the user to respond. */
|
|
|
|
|
|
|
|
+ e_flag_wait (data->done);
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ /* 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;
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- msg->noreply = 1;
|
|
|
|
- msg->noreply = 1;
|
|
|
|
+ remember = data->flags & E_PASSWORDS_REMEMBER_MASK;
|
|
|
|
+ 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,
|
|
|
@ -1219,26 +1203,25 @@
|
|
|
|
- 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 (remember == E_PASSWORDS_REMEMBER_NEVER)
|
|
|
|
+ if (data->remember || remember == E_PASSWORDS_REMEMBER_FOREVER)
|
|
|
|
+ goto cleanup;
|
|
|
|
+ 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_add_password (msg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- gtk_dialog_set_default_response(password_dialog, GTK_RESPONSE_OK);
|
|
|
|
|
|
|
|
+ if (data->remember && remember == E_PASSWORDS_REMEMBER_FOREVER)
|
|
|
|
+ if (data->remember && remember == E_PASSWORDS_REMEMBER_FOREVER)
|
|
|
|
+ ep_remember_password (msg);
|
|
|
|
+ ep_remember_password (msg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- gtk_dialog_set_default_response(password_dialog, GTK_RESPONSE_OK);
|
|
|
|
|
|
|
|
+cleanup:
|
|
|
|
|
|
|
|
|
|
|
|
- vbox = gtk_vbox_new (FALSE, 12);
|
|
|
|
- vbox = gtk_vbox_new (FALSE, 12);
|
|
|
|
- gtk_widget_show (vbox);
|
|
|
|
- gtk_widget_show (vbox);
|
|
|
|
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (password_dialog)->vbox), vbox, TRUE, FALSE, 0);
|
|
|
|
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (password_dialog)->vbox), vbox, TRUE, FALSE, 0);
|
|
|
|
- gtk_container_set_border_width((GtkContainer *)vbox, 12);
|
|
|
|
- gtk_container_set_border_width((GtkContainer *)vbox, 12);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- msg->entry = gtk_entry_new ();
|
|
|
|
- msg->entry = gtk_entry_new ();
|
|
|
|
+cleanup:
|
|
|
|
+ password = g_strdup (msg->password);
|
|
|
|
|
|
|
|
|
|
|
|
- a11y = gtk_widget_get_accessible (msg->entry);
|
|
|
|
- a11y = gtk_widget_get_accessible (msg->entry);
|
|
|
|
- atk_object_set_description (a11y, msg->prompt);
|
|
|
|
- atk_object_set_description (a11y, msg->prompt);
|
|
|
@ -1262,8 +1245,14 @@
|
|
|
|
- g_free (msg->password);
|
|
|
|
- g_free (msg->password);
|
|
|
|
- msg->password = NULL;
|
|
|
|
- msg->password = NULL;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
+ /* Close the express queue and process any messages there. */
|
|
|
|
+ password = g_strdup (msg->password);
|
|
|
|
+ g_async_queue_lock (express_queue);
|
|
|
|
|
|
|
|
+ express_key = NULL;
|
|
|
|
|
|
|
|
+ while ((msg = g_async_queue_try_pop_unlocked (express_queue))) {
|
|
|
|
|
|
|
|
+ msg->password = g_strdup (password);
|
|
|
|
|
|
|
|
+ e_flag_set (msg->done);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
+ g_async_queue_unlock (express_queue);
|
|
|
|
|
|
|
|
|
|
|
|
- /* static password, shouldn't be remembered between sessions,
|
|
|
|
- /* static password, shouldn't be remembered between sessions,
|
|
|
|
- but will be remembered within the session beyond our control */
|
|
|
|
- but will be remembered within the session beyond our control */
|
|
|
@ -1283,17 +1272,10 @@
|
|
|
|
- if ((msg->flags & E_PASSWORDS_DISABLE_REMEMBER))
|
|
|
|
- if ((msg->flags & E_PASSWORDS_DISABLE_REMEMBER))
|
|
|
|
- gtk_widget_set_sensitive(msg->check, FALSE);
|
|
|
|
- gtk_widget_set_sensitive(msg->check, FALSE);
|
|
|
|
- gtk_widget_show (msg->check);
|
|
|
|
- gtk_widget_show (msg->check);
|
|
|
|
+ /* Close the express queue and process any messages there. */
|
|
|
|
- }
|
|
|
|
+ g_async_queue_lock (express_queue);
|
|
|
|
|
|
|
|
+ express_key = NULL;
|
|
|
|
|
|
|
|
+ while ((msg = g_async_queue_try_pop_unlocked (express_queue))) {
|
|
|
|
|
|
|
|
+ msg->password = g_strdup (password);
|
|
|
|
|
|
|
|
+ e_flag_set (msg->done);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- msg->noreply = noreply;
|
|
|
|
- msg->noreply = noreply;
|
|
|
|
+ g_async_queue_unlock (express_queue);
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
- g_signal_connect(password_dialog, "response", G_CALLBACK (pass_response), msg);
|
|
|
|
- g_signal_connect(password_dialog, "response", G_CALLBACK (pass_response), msg);
|
|
|
|
- gtk_widget_show((GtkWidget *)password_dialog);
|
|
|
|
- gtk_widget_show((GtkWidget *)password_dialog);
|
|
|
|
+ g_free (password);
|
|
|
|
+ g_free (password);
|
|
|
@ -1383,7 +1365,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
|
|
|
|
@@ -972,10 +1055,11 @@ e_passwords_shutdown (void)
|
|
|
|
@@ -967,10 +1058,11 @@ e_passwords_shutdown (void)
|
|
|
|
* FIXME: This is not a permanent api, review post 2.0.
|
|
|
|
* FIXME: This is not a permanent api, review post 2.0.
|
|
|
|
**/
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
void
|
|
|
@ -1398,7 +1380,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@@ -986,150 +1070,137 @@ e_passwords_set_online(int state)
|
|
|
|
@@ -981,151 +1073,138 @@ e_passwords_set_online(int state)
|
|
|
|
void
|
|
|
|
void
|
|
|
|
e_passwords_forget_passwords (void)
|
|
|
|
e_passwords_forget_passwords (void)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1603,7 +1585,8 @@
|
|
|
|
+ * @key: key to store the password under, or NULL
|
|
|
|
+ * @key: key to store the password under, or NULL
|
|
|
|
* @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,
|
|
|
|
@@ -1146,241 +1217,44 @@ e_passwords_add_password (const char *ke
|
|
|
|
* and for how long.
|
|
|
|
|
|
|
|
@@ -1140,241 +1219,44 @@ e_passwords_add_password (const char *ke
|
|
|
|
* 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.
|
|
|
|
**/
|
|
|
|
**/
|
|
|
@ -1873,8 +1856,8 @@
|
|
|
|
- return (char *)plain;
|
|
|
|
- return (char *)plain;
|
|
|
|
+ return password;
|
|
|
|
+ return password;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--- evolution-data-server-1.11.2/libedataserver/e-msgport.h.e-passwords 2007-04-18 06:10:18.000000000 -0400
|
|
|
|
--- evolution-data-server-1.11.4/libedataserver/e-msgport.h.e-passwords 2007-04-18 06:10:18.000000000 -0400
|
|
|
|
+++ evolution-data-server-1.11.2/libedataserver/e-msgport.h 2007-05-31 22:51:17.000000000 -0400
|
|
|
|
+++ evolution-data-server-1.11.4/libedataserver/e-msgport.h 2007-06-18 16:19:44.000000000 -0400
|
|
|
|
@@ -54,7 +54,7 @@ typedef struct _EMsgPort EMsgPort;
|
|
|
|
@@ -54,7 +54,7 @@ typedef struct _EMsgPort EMsgPort;
|
|
|
|
|
|
|
|
|
|
|
|
/* header for any message */
|
|
|
|
/* header for any message */
|
|
|
|