GNOME Bugzilla – Bug 504335
Password operations should return status
Last modified: 2012-06-10 14:00:59 UTC
The e_passwords_xxx_password() functions all return void. But it's possible for keyring and even keyfile operations to fail. At least keyfile failures generate a warning on the terminal, but keyring operations just swallow the error. A better solution would be to have all these functions take a GError and return a boolean. This would be an API break but I think it's worth it. Specifically, I'm proposing: gboolean e_passwords_remember_password(..., GError **error) gboolean e_passwords_add_password(..., GError **error) gboolean e_passwords_get_password(..., GError **error) gboolean e_passwords_forget_password(..., GError **error) gboolean e_passwords_forget_passwords(..., GError **error) gboolean e_passwords_clear_passwords(..., GError **error) One place I discovered recently where this would be useful is in load_source_auth_cb() (e-book-auth-util.c). This logic: if (status == E_BOOK_ERROR_AUTHENTICATION_FAILED) e_passwords_forget_password (component_name, stripped_uri); addressbook_authenticate (book, TRUE, data->source, load_source_auth_cb, closure); could be better written as: if (status != E_BOOK_ERROR_AUTHENTICATION_FAILED || e_passwords_forget_password (component_name, stripped_uri, &error)) addressbook_authenticate (book, TRUE, data->source, load_source_auth_cb, closure); to avoid a potential busy loop in case "forget password" fails.
Bumping version to a stable release.
*** Bug 532978 has been marked as a duplicate of this bug. ***
Putting this back on my radar for 3.0 since we finally have an opportunity to fix broken API.
The e-passwords API is deprecated as of Evolution 3.5.3. We have a much better authentication API now for backends. Client apps no longer have to deal with authentication at all. Not worth an API break at this point. Closing as OBSOLETE.