Bugzilla – Attachment 118225 Details for
Bug 222479
Evolution never saves password for IMAP and SMTP
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
Submitted patch
bnc-222479-keyring-fallback.diff (text/plain), 9.41 KB, created by
Srinivasa Ragavan
on 2007-02-09 06:25:51 UTC
(
hide
)
Description:
Submitted patch
Filename:
MIME Type:
Creator:
Srinivasa Ragavan
Created:
2007-02-09 06:25:51 UTC
Size:
9.41 KB
patch
obsolete
>Index: e-passwords.c >=================================================================== >--- libedataserverui/e-passwords.c (revision 7342) >+++ libedataserverui/e-passwords.c (working copy) >@@ -194,7 +194,7 @@ ep_msg_send(EPassMsg *msg) > /* the functions that actually do the work */ > #if WITH_GNOME_KEYRING > static void >-ep_clear_passwords(EPassMsg *msg) >+ep_clear_passwords_keyring(EPassMsg *msg) > { > GnomeKeyringAttributeList *attributes; > GnomeKeyringAttribute attribute; >@@ -234,7 +234,7 @@ ep_clear_passwords(EPassMsg *msg) > } else { > for (tmp = matches; tmp; tmp = tmp->next) { > result = gnome_keyring_item_delete_sync (default_keyring, ((GnomeKeyringFound *) tmp->data)->item_id); >- d(g_printf("Delete Items %d\n", result)); >+ d(g_print("Delete Items %d\n", result)); > } > } > >@@ -242,9 +242,9 @@ ep_clear_passwords(EPassMsg *msg) > if (!msg->noreply) > e_msgport_reply(&msg->msg); > } >-#else >+#endif > static void >-ep_clear_passwords(EPassMsg *msg) >+ep_clear_passwords_file(EPassMsg *msg) > { > char *path; > >@@ -258,7 +258,6 @@ ep_clear_passwords(EPassMsg *msg) > if (!msg->noreply) > e_msgport_reply(&msg->msg); > } >-#endif > > static gboolean > free_entry (gpointer key, gpointer value, gpointer user_data) >@@ -271,7 +271,7 @@ free_entry (gpointer key, gpointer value > > #if WITH_GNOME_KEYRING > static void >-ep_forget_passwords(EPassMsg *msg) >+ep_forget_passwords_keyring(EPassMsg *msg) > { > GnomeKeyringAttributeList *attributes; > GnomeKeyringAttribute attribute; >@@ -309,7 +309,7 @@ ep_forget_passwords(EPassMsg *msg) > } else { > for (tmp = matches; tmp; tmp = tmp->next) { > result = gnome_keyring_item_delete_sync (default_keyring, ((GnomeKeyringFound *) tmp->data)->item_id); >- d(g_printf("Delete Items %d\n", result)); >+ d(g_print("Delete Items %d\n", result)); > } > } > >@@ -321,9 +321,10 @@ ep_forget_passwords(EPassMsg *msg) > if (!msg->noreply) > e_msgport_reply(&msg->msg); > } >-#else >+#endif >+ > static void >-ep_forget_passwords(EPassMsg *msg) >+ep_forget_passwords_file(EPassMsg *msg) > { > void *it; > char *key; >@@ -347,7 +348,6 @@ ep_forget_passwords(EPassMsg *msg) > if (!msg->noreply) > e_msgport_reply(&msg->msg); > } >-#endif > > static char * > password_path (const char *component_name, const char *key) >@@ -369,19 +369,17 @@ password_path (const char *component_nam > > #if WITH_GNOME_KEYRING > static void >-ep_remember_password(EPassMsg *msg) >+ep_remember_password_keyring(EPassMsg *msg) > { > gpointer okey, value; >- int len, state, save; > > if (g_hash_table_lookup_extended (passwords, msg->key, &okey, &value)) { > /* add it to the on-disk cache of passwords */ > GnomeKeyringAttributeList *attributes; > GnomeKeyringAttribute attribute; > GnomeKeyringResult result; >- GList *pass = NULL, *tmp; > EUri *uri = e_uri_new (okey); >- int item_id; >+ guint32 item_id; > > if (!strcmp (uri->protocol, "ldap") && !uri->user) { > /* LDAP doesnt use username in url. Let the url be the user key. So safe it */ >@@ -431,9 +429,10 @@ ep_remember_password(EPassMsg *msg) > if (!msg->noreply) > e_msgport_reply(&msg->msg); > } >-#else >+#endif >+ > static void >-ep_remember_password(EPassMsg *msg) >+ep_remember_password_file(EPassMsg *msg) > { > gpointer okey, value; > char *path, *pass64; >@@ -463,17 +462,15 @@ ep_remember_password(EPassMsg *msg) > if (!msg->noreply) > e_msgport_reply(&msg->msg); > } >-#endif > > #if WITH_GNOME_KEYRING > static void >-ep_forget_password (EPassMsg *msg) >+ep_forget_password_keyring (EPassMsg *msg) > { > GnomeKeyringAttributeList *attributes; > GnomeKeyringAttribute attribute; > GnomeKeyringResult result; > GList *matches = NULL, *tmp; >- char *path; > char *default_keyring = NULL; > gpointer okey, value; > EUri *uri = e_uri_new (msg->key); >@@ -563,7 +560,7 @@ ep_forget_password (EPassMsg *msg) > } > if (present == 2 && accept) { > result = gnome_keyring_item_delete_sync (default_keyring, ((GnomeKeyringFound *) tmp->data)->item_id); >- d(g_printf("Delete Items %s %s %d\n", uri->host, uri->user, result)); >+ d(g_print("Delete Items %s %s %d\n", uri->host, uri->user, result)); > } > } > >@@ -574,9 +571,10 @@ ep_forget_password (EPassMsg *msg) > if (!msg->noreply) > e_msgport_reply(&msg->msg); > } >-#else >+#endif >+ > static void >-ep_forget_password (EPassMsg *msg) >+ep_forget_password_file (EPassMsg *msg) > { > gpointer okey, value; > char *path; >@@ -595,14 +597,13 @@ ep_forget_password (EPassMsg *msg) > if (!msg->noreply) > e_msgport_reply(&msg->msg); > } >-#endif >+ > > #if WITH_GNOME_KEYRING > static void >-ep_get_password (EPassMsg *msg) >+ep_get_password_keyring (EPassMsg *msg) > { >- char *path, *passwd; >- char *encoded = NULL; >+ char *passwd; > GnomeKeyringAttributeList *attributes; > GnomeKeyringAttribute attribute; > GnomeKeyringResult result; >@@ -688,11 +686,12 @@ ep_get_password (EPassMsg *msg) > > if (!msg->noreply) > e_msgport_reply(&msg->msg); >-} >-#else >+} >+#endif >+ > static void >-ep_get_password (EPassMsg *msg) >-{ >+ep_get_password_file (EPassMsg *msg) >+{ > char *path, *passwd; > char *encoded = NULL; > >@@ -713,7 +712,6 @@ ep_get_password (EPassMsg *msg) > if (!msg->noreply) > e_msgport_reply(&msg->msg); > } >-#endif > > static void > ep_add_password (EPassMsg *msg) >@@ -756,9 +754,17 @@ pass_response(GtkDialog *dialog, int res > msg->oldpass = msg->password; > ep_add_password(msg); > } >- >+#if WITH_GNOME_KEYRING >+ if (*msg->remember && type == E_PASSWORDS_REMEMBER_FOREVER) { >+ if (gnome_keyring_is_available()) >+ ep_remember_password_keyring(msg); >+ else >+ ep_remember_password_file(msg); >+ } >+#else > if (*msg->remember && type == E_PASSWORDS_REMEMBER_FOREVER) >- ep_remember_password(msg); >+ ep_remember_password_file(msg); >+#endif > > msg->noreply = noreply; > } >@@ -775,9 +781,17 @@ pass_response(GtkDialog *dialog, int res > mw = (EPassMsg *)request_list.head; > mn = (EPassMsg *)mw->msg.ln.next; > while (mn) { >- if ((mw->dispatch == ep_forget_password >- || mw->dispatch == ep_get_password >- || mw->dispatch == ep_ask_password) >+#if WITH_GNOME_KEYRING >+ if ((mw->dispatch == (gnome_keyring_is_available() ? ep_forget_password_keyring : ep_forget_password_file) >+#else >+ if ((mw->dispatch == ep_forget_password_file >+#endif >+#if WITH_GNOME_KEYRING >+ || mw->dispatch == (gnome_keyring_is_available() ? ep_get_password_keyring : ep_get_password_file) >+#else >+ || mw->dispatch == ep_get_password_file >+#endif >+ || mw->dispatch == ep_ask_password) > && (strcmp(mw->component, msg->component) == 0 > && strcmp(mw->key, msg->key) == 0)) { > e_dlist_remove((EDListNode *)mw); >@@ -838,7 +852,14 @@ ep_ask_password(EPassMsg *msg) > gtk_widget_grab_focus (msg->entry); > > if ((msg->flags & E_PASSWORDS_REPROMPT)) { >- ep_get_password(msg); >+#if WITH_GNOME_KEYRING >+ if (gnome_keyring_is_available()) >+ ep_get_password_keyring(msg); >+ else >+ ep_get_password_file(msg); >+#else >+ ep_get_password_file(msg); >+#endif > if (msg->password) { > gtk_entry_set_text ((GtkEntry *) msg->entry, msg->password); > g_free (msg->password); >@@ -923,8 +944,11 @@ e_passwords_cancel(void) > void > e_passwords_shutdown (void) > { >+#ifdef WITH_GNOME_KEYRING > /* shouldn't need this really - everything is synchronous */ >-#if !WITH_GNOME_KEYRING >+ if (!gnome_keyring_is_available()) >+ gnome_config_private_sync_file ("/Evolution"); >+#else > gnome_config_private_sync_file ("/Evolution"); > #endif > e_passwords_cancel(); >@@ -962,8 +986,12 @@ e_passwords_set_online(int state) > void > e_passwords_forget_passwords (void) > { >- EPassMsg *msg = ep_msg_new(ep_forget_passwords); >- >+#if WITH_GNOME_KEYRING >+ EPassMsg *msg = ep_msg_new(gnome_keyring_is_available() ? ep_forget_passwords_keyring : ep_forget_passwords_file); >+#else >+ EPassMsg *msg = ep_msg_new(ep_forget_passwords_file); >+#endif >+ > ep_msg_send(msg); > ep_msg_free(msg); > } >@@ -976,7 +1004,11 @@ e_passwords_forget_passwords (void) > void > e_passwords_clear_passwords (const char *component_name) > { >- EPassMsg *msg = ep_msg_new(ep_clear_passwords); >+#if WITH_GNOME_KEYRING >+ EPassMsg *msg = ep_msg_new(gnome_keyring_is_available() ? ep_clear_passwords_keyring : ep_clear_passwords_file); >+#else >+ EPassMsg *msg = ep_msg_new(ep_clear_passwords_file); >+#endif > > msg->component = component_name; > ep_msg_send(msg); >@@ -997,8 +1029,11 @@ e_passwords_remember_password (const cha > g_return_if_fail(component_name != NULL); > g_return_if_fail(key != NULL); > >- msg = ep_msg_new(ep_remember_password); >- >+#if WITH_GNOME_KEYRING >+ msg = ep_msg_new(gnome_keyring_is_available() ? ep_remember_password_keyring : ep_remember_password_file); >+#else >+ msg = ep_msg_new(ep_remember_password_file); >+#endif > msg->component = component_name; > msg->key = key; > >@@ -1020,8 +1055,11 @@ e_passwords_forget_password (const char > g_return_if_fail(component_name != NULL); > g_return_if_fail(key != NULL); > >- msg = ep_msg_new(ep_forget_password); >- >+#if WITH_GNOME_KEYRING >+ msg = ep_msg_new(gnome_keyring_is_available() ? ep_forget_password_keyring : ep_forget_password_file); >+#else >+ msg = ep_msg_new(ep_forget_password_file); >+#endif > msg->component = component_name; > msg->key = key; > >@@ -1045,7 +1083,11 @@ e_passwords_get_password (const char *co > g_return_val_if_fail(component_name != NULL, NULL); > g_return_val_if_fail(key != NULL, NULL); > >- msg = ep_msg_new(ep_get_password); >+#if WITH_GNOME_KEYRING >+ msg = ep_msg_new(gnome_keyring_is_available() ? ep_get_password_keyring : ep_get_password_file); >+#else >+ msg = ep_msg_new(ep_get_password_file); >+#endif > > msg->component = component_name; > msg->key = key;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 222479
: 118225