After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 504335 - Password operations should return status
Password operations should return status
Status: RESOLVED OBSOLETE
Product: evolution-data-server
Classification: Platform
Component: general
2.30.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
evolution[passwords] evolution[gnome3]
: 532978 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-12-18 20:46 UTC by Matthew Barnes
Modified: 2012-06-10 14:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matthew Barnes 2007-12-18 20:46:37 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.
Comment 1 Matthew Barnes 2008-03-11 01:01:47 UTC
Bumping version to a stable release.
Comment 2 Matthew Barnes 2008-05-13 16:49:42 UTC
*** Bug 532978 has been marked as a duplicate of this bug. ***
Comment 3 Matthew Barnes 2010-04-18 12:21:28 UTC
Putting this back on my radar for 3.0 since we finally have an opportunity to fix broken API.
Comment 4 Matthew Barnes 2012-06-10 14:00:59 UTC
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.