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 679851 - libsecret migration
libsecret migration
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks: 679893
 
 
Reported: 2012-07-13 12:31 UTC by Stef Walter
Modified: 2013-03-04 18:05 UTC
See Also:
GNOME target: 3.8
GNOME version: ---


Attachments
WIP patch to migrate to libsecret (14.93 KB, patch)
2012-07-13 12:31 UTC, Stef Walter
none Details | Review
WIP patch to migrate to libsecret (14.92 KB, patch)
2012-07-14 06:44 UTC, Stef Walter
reviewed Details | Review
Migrate from libgnome-keyring to libsecret (14.98 KB, patch)
2013-03-04 14:01 UTC, Stef Walter
committed Details | Review

Description Stef Walter 2012-07-13 12:31:22 UTC
Created attachment 218712 [details] [review]
WIP patch to migrate to libsecret

libsecret is a new client for the Secret Service DBus API. The Secret Service
allows storage of passwords in a common way on the desktop. Supported by
gnome-keyring and ksecretservice.

It solves many problems with libgnome-keyring. Relevant to gnome-shell: it
solves threading issues, uses GDBus instead of dbus-glib, and makes
cancellation much cleaner. 

A future GNOME goal will be to migrate away from libgnome-keyring to libsecret:

https://live.gnome.org/GnomeGoals/LibsecretMigration

The use of libgnome-keyring in gnome-shell was in the network manager agent. I've done a rough WIP patch in order to make sure that the libsecret API covered all the use cases. I'll attach that patch here. 

You'll probably want to wait for bug #679849 before doing this, so that both nm-agents can use the same schema name for the stored passwords. Note that libsecret can read passwords stored via libgnome-keyring, so this isn't a hard dependency.

I hope the patch is a help for the migration, but I don't plan to iterate on it at the current time.

Some notes about the patch:

 * I chose an arbitrary schema name, probably want to sync this up with
   network-manager-applet.
     org.freedesktop.NetworkManager.Connection
 * I haven't tested the patch. I'm not familiar with how to trigger all the
   various code paths and logic.


Note that the patch uses the unstable 'advanced' parts of the libsecret API. See bug #679849 for why.

I'm aiming to get most of this stable by GNOME 3.8, but if you do migrate to
libsecret before then, I would patch network-manager-applet for any API changes
that come up.
Comment 1 Olav Vitters 2012-07-13 20:40:59 UTC
Per r-t: Targetting GNOME 3.6
Comment 2 Stef Walter 2012-07-14 06:44:15 UTC
Created attachment 218791 [details] [review]
WIP patch to migrate to libsecret

Updated for last minute API change.
Comment 3 Stef Walter 2012-07-14 11:17:31 UTC
BTW, just a heads up: Please look at the patch critically. I did the patch as a way to try out the API, and it's not ready to commit. There may be memory leaks or other logic errors. Most libsecret getters return data that must be unreferenced or freed.
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-08-23 04:18:46 UTC
Just want to point out that a large part of shell-network-agent.c was stolen from http://git.gnome.org/browse/network-manager-applet/tree/src/applet-agent.c, so you should probably update that at the same time.
Comment 5 Matthias Clasen 2012-09-17 19:45:23 UTC
Moving off the 3.6 blocker list
Comment 6 Matthias Clasen 2013-01-02 04:22:39 UTC
Would be nice to get this done for 3.8
Comment 7 Jasper St. Pierre (not reading bugmail) 2013-02-18 09:27:29 UTC
Review of attachment 218791 [details] [review]:

Looks OK, one minor nit.

::: src/shell-network-agent.c
@@ +278,3 @@
+    {
+      g_error_free (secret_error);
+      return;

Should we not remove it from the requests HT? Seems to be an existing error, but still...
Comment 8 Matthias Clasen 2013-03-04 12:58:59 UTC
if it is an existing error, should we file a separate bug about it, and get this one out of the way ?
Comment 9 Stef Walter 2013-03-04 14:01:28 UTC
Created attachment 237985 [details] [review]
Migrate from libgnome-keyring to libsecret

* See: https://live.gnome.org/GnomeGoals/LibsecretMigration

https://bugzilla.gnome.org/show_bug.cgi?id=679851
Comment 10 Stef Walter 2013-03-04 14:02:43 UTC
Rebased on master...

(In reply to comment #7)
> Should we not remove it from the requests HT? Seems to be an existing error,
> but still...

It's cancelled because it has been removed from the hash table already. See the g_cancellable_cancel() call in shell_agent_request_free(), which is only called as a GDestroyNotify for the hash table.
Comment 11 Florian Müllner 2013-03-04 17:34:51 UTC
Review of attachment 237985 [details] [review]:

LGTM
Comment 12 Stef Walter 2013-03-04 18:05:24 UTC
Pushed to git master.

Attachment 237985 [details] pushed as dac54a6 - Migrate from libgnome-keyring to libsecret