screenlets-dev team mailing list archive
-
screenlets-dev team
-
Mailing list archive
-
Message #00228
[Bug 569765] [NEW] Error storing/reveiving passwords into/from gnome-keyring
Public bug reported:
Using any screenlet in Ubuntu Karmic which has password stored with
AccountOption into gnome-keyring, the password won't be received after
logout any more. Screenlets report "ERROR: Unable to read password from
keyring:" and that's all. It is quite mainstram in TwitterScreenlet
bugtracking http://code.google.com/p/twitterscreenlet/updates/list, for
example. For me the problem was fixed at first when I just reversed the
boolean operator fount in /usr/share/pyshared/screenlets/options.py
inside function on_import, so instead of if self.keyring ==
self.keyring_list[0] i used if self.keyring != self.keyring_list[0].
This made the password to be received all right.
The problem, however, seems to be that options.py makes a wild
presumption about the order of keys in the ring.
237 self.keyring_list = gnomekeyring.list_keyring_names_sync()
We have the keyrings' list now... But is there a default keyring defined?
--- Yes? Then let self.keyring represent "the default keyring".
--- No? Then let's take self.keyring represent "the whatever first keyring" that was available at the keyring...
(that is 246 self.keyring = self.keyring_list[0])
Now, in my case "the whatever first keyring" is "login" which happens to
be also "the default keyring", but I suppose "the whatever first
keyring" could be also "session" or "foobar", but there's no way to be
sure.
If we now look, what is done in on_import
258 if self.keyring == self.keyring_list[0]
and also on_export
278 if self.keyring == self.keyring_list[0]
then it seems that it is meant to detect if we had some default keyring defined... But it fails. It supposes, that when we have default keyring defined the self.keyring != self.keyring_list[0], but it may well happen otherwise, as in my case and for lot of other people referref above. I suppose the order of keyrings is changing through versions of gnome-keyring application or Linux distribution, and once the code worked, but now it's broken.
I suggest that since in on_export
279 auth_token = gnomekeyring.item_create_sync('session',
280 gnomekeyring.ITEM_GENERIC_SECRET, value[0], attribs, value[1], True)
"the whatever first keyring" is replaced with the system keyring "session" as the hard-coded string, the value "session" should be as well assigned already in __init__
246 self.keyring = self.keyring_list[0]
instead of "the whatever first keyring", i. e. it should be
246 self.keyring = "session"
The rest of hocus pocus with checking if there was default keyring or we are dealing some "random first keyring" should be removed and replaced with plain
262 pw = gnomekeyring.item_get_info_sync(self.keyring,
263 int(auth_token)).get_secret()
in case of on_import and with
282 auth_token = gnomekeyring.item_create_sync(self.keyring,
283 gnomekeyring.ITEM_GENERIC_SECRET, value[0], attribs, value[1], True)
in case of on_export...
That should do it.
If that's allright, I could check and fix the code myself.
** Affects: screenlets
Importance: Undecided
Status: New
--
Error storing/reveiving passwords into/from gnome-keyring
https://bugs.launchpad.net/bugs/569765
You received this bug notification because you are a member of
Screenlets Dev Team, which is subscribed to Screenlets.
Follow ups
-
[Bug 569765] Re: Error storing/reveiving passwords into/from gnome-keyring
From: Sebastien Bacher, 2012-06-04
-
[Bug 569765] Re: Error storing/reveiving passwords into/from gnome-keyring
From: Patrick Santos, 2012-06-03
-
[Bug 569765] Re: Error storing/reveiving passwords into/from gnome-keyring
From: Ubuntu Foundation's Bug Bot, 2012-05-23
-
[Bug 569765] Re: Error storing/reveiving passwords into/from gnome-keyring
From: dalailama, 2012-05-22
-
[Bug 569765] Re: Error storing/reveiving passwords into/from gnome-keyring
From: tabbernuk, 2011-06-27
-
[Bug 569765] Re: Error storing/reveiving passwords into/from gnome-keyring
From: tabbernuk, 2010-11-08
-
[Bug 569765] Re: Error storing/reveiving passwords into/from gnome-keyring
From: Shoichi Nanjo, 2010-09-29
-
[Bug 569765] Re: Error storing/reveiving passwords into/from gnome-keyring
From: Hasenkopf, Andreas, 2010-05-12
-
[Bug 569765] Re: Error storing/reveiving passwords into/from gnome-keyring
From: tabbernuk, 2010-05-06
-
[Bug 569765] Re: Error storing/reveiving passwords into/from gnome-keyring
From: tabbernuk, 2010-05-06
-
[Bug 569765] Re: Error storing/reveiving passwords into/from gnome-keyring
From: tabbernuk, 2010-04-27
-
[Bug 569765] Re: Error storing/reveiving passwords into/from gnome-keyring
From: tabbernuk, 2010-04-26
-
[Bug 569765] Re: Error storing/reveiving passwords into/from gnome-keyring
From: tabbernuk, 2010-04-25
-
[Bug 569765] [NEW] Error storing/reveiving passwords into/from gnome-keyring
From: tabbernuk, 2010-04-25
References