[Bug 805855] New: osc does not use KWallet using KDE
https://bugzilla.novell.com/show_bug.cgi?id=805855 https://bugzilla.novell.com/show_bug.cgi?id=805855#c0 Summary: osc does not use KWallet using KDE Classification: openSUSE Product: openSUSE 12.2 Version: Final Platform: x86-64 OS/Version: openSUSE 12.2 Status: NEW Severity: Normal Priority: P5 - None Component: Development AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: nico.kruber@gmail.com QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0 I'm on KDE and have keyring support enabled for osc. Both gnome-keyring and kwallet are installed and seem to be running. From what I understand from https://bitbucket.org/kang/python-keyring-lib the keyring lib should choose the most appropriate keyring implementation itself, however, it seems to choose the gnome-keyring which hits this bug https://bitbucket.org/kang/python-keyring-lib/issue/65/dbusexception-method-... and consequently fails to get my password (which is stored in kwallet anyway) adding a call to keyring.core.init_backend() before line 804 of conf.py https://github.com/openSUSE/osc/blob/e2dc1d7fe655d61654d0c442704320fa3e5688e... seems to fix this (keyring then uses my kwallet and retrieves my password). However, this method should have been called already during the keyring import if I understand it correctly - see /usr/lib/python2.7/site-packages/keyring/core.py adding this call directly after the line loading the module however does not seem to be sufficient Reproducible: Always Steps to Reproduce: 1. boot into KDE 2. store osc password in kwallet 3. get into an osc checkout and use "osc up" -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=805855 https://bugzilla.novell.com/show_bug.cgi?id=805855#c1 Nico Kruber <nico.kruber@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nico.kruber@gmail.com --- Comment #1 from Nico Kruber <nico.kruber@gmail.com> 2013-02-26 10:37:15 UTC --- after further investigations, I'd guess it is a timing issue. The proposed workaround does not seem to work for me anymore if I change the exception handler to the following I only get the password from KWallet if I un-comment the "print 'test'" directly after the password assignment. ---------- try: # Read from keyring lib if available user = cp.get(url, 'user', raw=True) password = keyring.get_password(host, user) #print 'test' except Exception as instance: print 'failed with ' + str(instance) # Fallback to file based auth. #pass ---------- Now I have reverted the conf.py to its original state (0.139.0-93.1 from openSUSE:Tools) and applied the fix from https://bugzilla.novell.com/show_bug.cgi?id=801027 and it seems to always take KWallet now. Anyway, using the osc command starts the "gnome-keyring-daemon" which is probably the fault of the keyring library... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=805855 https://bugzilla.novell.com/show_bug.cgi?id=805855#c FeiXiang Zhang <fxzhang@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team-screening@forge.pr |suse-tux@gmx.de |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c2 Ákos Szőts <szotsaki@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |szotsaki@gmail.com Component|Development |osc Version|Final |master Product|openSUSE 12.2 |openSUSE Build Service QA Contact|qa-bugs@suse.de |adrian@suse.com --- Comment #2 from Ákos Szőts <szotsaki@gmail.com> --- It's still an issue with osc 0.155git. Even "--no-gnome-keyring" is ignored. This is the case with Leap 42.1's python-keyring 5.3 and with the latest version 9.3.1. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c3 --- Comment #3 from Marcus Hüwe <suse-tux@gmx.de> --- Do you also have gnome-keyring installed? If so, can you try to remove this package? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c4 --- Comment #4 from Ákos Szőts <szotsaki@gmail.com> --- Yes, I had it, but removed along with gnome-keyring-lang and gnome-keyring-pam. libgnome-keyring0 is still on the system. I opened KWalletManager and the application itself works fine. When I forced the use of keyrings in .oscrc then the following exception occurred: Gkr-Message: secret service operation failed: The name org.freedesktop.secrets was not provided by any .service files Traceback (most recent call last): File "/usr/bin/osc", line 41, in <module> r = babysitter.run(osccli) File "/usr/lib/python2.7/site-packages/osc/babysitter.py", line 61, in run return prg.main(argv) File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 335, in main self.postoptparse() File "/usr/lib/python2.7/site-packages/osc/commandline.py", line 160, in postoptparse conf.add_section(e.file, e.url, user, passwd) File "/usr/lib/python2.7/site-packages/osc/conf.py", line 773, in add_section keyring.set_password(host, user, passwd) File "/usr/lib/python2.7/site-packages/keyring/core.py", line 44, in set_password _keyring_backend.set_password(service_name, username, password) File "/usr/lib/python2.7/site-packages/keyring/backends/Gnome.py", line 96, in set_password raise PasswordSetError(result.value_name) keyring.errors.PasswordSetError: GNOME_KEYRING_RESULT_IO_ERROR -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c5 --- Comment #5 from Marcus Hüwe <suse-tux@gmx.de> --- Can you post the output of rpm -qf /usr/lib/python2.7/site-packages/keyring/backends/Gnome.py ? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c6 --- Comment #6 from Ákos Szőts <szotsaki@gmail.com> --- It's in python-keyring-5.3-2.2.noarch. When I try to remove only "python-keyring-gnome", the whole python-keyring wants to go with it (python-keyring-gnome is just a feature of python-keyring). -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c7 --- Comment #7 from Marcus Hüwe <suse-tux@gmx.de> --- (In reply to Ákos Szőts from comment #6)
It's in python-keyring-5.3-2.2.noarch.
Interesting - the python-keyring from Tumbleweed doesn't ship this file. Can you create the file /home/<username>/.local/share/python_keyring/keyringrc.cfg with the following content: [backend] default-keyring = keyring.backends.kwallet.DBusKeyring and try it again? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c8 --- Comment #8 from Ákos Szőts <szotsaki@gmail.com> --- Well, strange things happen. I created the file and now the exception is gone. When I use "use_keyring = 1" in [genereal], it still stores the password in the .oscrc file. When I remove user=a and pass=a from [https://api.opensuse.org] and replace them with "keyring = 1" it doesn't ask for password again, but "osc up" works. It doesn't matter if KWalletManager is opened/closed, the program doesn't ask for permission. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c9 --- Comment #9 from Marcus Hüwe <suse-tux@gmx.de> --- (In reply to Ákos Szőts from comment #8)
It doesn't matter if KWalletManager is opened/closed, the program doesn't ask for permission.
It probably uses the cookie. Remove ~/.osc_cookiejar as well. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c10 --- Comment #10 from Ákos Szőts <szotsaki@gmail.com> --- Thank you, it helped. Scenarios with "osc up" and the deletion of ~/.osc_cookiejar: [general] use_keyring = 1 [https://api.opensuse.org] keyring = 1 -> Replaced to [https://api.opensuse.org] user=a pass=a With just [general] and the deletion of ~/.osc_cookiejar: [general] use_keyring = 1 -> Created an entry: [https://api.opensuse.org] user=a pass=a -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c11 --- Comment #11 from Marcus Hüwe <suse-tux@gmx.de> --- (In reply to Ákos Szőts from comment #10)
Thank you, it helped.
That is, it is working now?:) If not, can please remove the ~/.oscrc file as well? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c12 --- Comment #12 from Ákos Szőts <szotsaki@gmail.com> --- No, unfortunately it still writes the password to the .oscrc file. After deleting it and the cookiejar as well, osc asked for my password again, but it went again to the .oscrc (without any KWallatManager permission dialogues). -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c13 --- Comment #13 from Marcus Hüwe <suse-tux@gmx.de> --- (In reply to Ákos Szőts from comment #12)
No, unfortunately it still writes the password to the .oscrc file.
After deleting it and the cookiejar as well, osc asked for my password again, but it went again to the .oscrc (without any KWallatManager permission dialogues).
Hmm this is strange. What's the output of python -c 'import keyring; keyring.core.load_config()' -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c14 --- Comment #14 from Ákos Szőts <szotsaki@gmail.com> --- python -c 'import keyring; keyring.core.load_config()' : Normal user: Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python2.7/site-packages/keyring/__init__.py", line 12, in <module> from .core import (set_keyring, get_keyring, set_password, get_password, File "/usr/lib/python2.7/site-packages/keyring/core.py", line 158, in <module> init_backend() File "/usr/lib/python2.7/site-packages/keyring/core.py", line 58, in init_backend set_keyring(load_config() or _get_best_keyring()) File "/usr/lib/python2.7/site-packages/keyring/core.py", line 113, in load_config return load_keyring(keyring_name) File "/usr/lib/python2.7/site-packages/keyring/core.py", line 81, in load_keyring class_ = getattr(module, class_name) AttributeError: 'module' object has no attribute 'DBusKeyring' But with root user it returns nothing and $? is zero. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c15 --- Comment #15 from Marcus Hüwe <suse-tux@gmx.de> --- Ok... that explains why osc doesn't use the keyring. In python-keyring 5.3 the class is named different. Can you please adjust the ~/.local/share/python_keyring/keyringrc.cfg: [backend] default-keyring = keyring.backends.kwallet.Keyring Afterwards, try the following: - osc config general use_keyring 1 - rm ~/.osc_cookiejar - manually remove the [https://api.opensuse.org] section from the ~/.oscrc - run osc again Now it should ask for your credentials and should store it in your keyring. If this doesn't work, please post the output of python -c 'import keyring.backends.kwallet.Keyring' -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c16 --- Comment #16 from Ákos Szőts <szotsaki@gmail.com> --- Unfortunately, it doesn't work. python -c 'import keyring.backends.kwallet.Keyring': Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python2.7/site-packages/keyring/__init__.py", line 12, in <module> from .core import (set_keyring, get_keyring, set_password, get_password, File "/usr/lib/python2.7/site-packages/keyring/core.py", line 158, in <module> init_backend() File "/usr/lib/python2.7/site-packages/keyring/core.py", line 58, in init_backend set_keyring(load_config() or _get_best_keyring()) File "/usr/lib/python2.7/site-packages/keyring/core.py", line 113, in load_config return load_keyring(keyring_name) File "/usr/lib/python2.7/site-packages/keyring/core.py", line 83, in load_keyring class_.priority File "/usr/lib/python2.7/site-packages/keyring/util/properties.py", line 22, in __get__ return self.fget.__get__(None, owner)() File "/usr/lib/python2.7/site-packages/keyring/util/XDG.py", line 18, in wrapper return func(*args, **kwargs) * self.multiplier File "/usr/lib/python2.7/site-packages/keyring/backends/kwallet.py", line 64, in priority raise RuntimeError("KDE libraries not available") RuntimeError: KDE libraries not available However, python-keyring-kde _is_ installed. The following kwallet* packages are also installed: --+--------------------------------------+----------- | kwallet | srcpackage | kwallet-debugsource | package | kwallet-devel | package | kwallet-devel-32bit | package i | kwallet-tools | package | kwallet-tools-debuginfo | package i | kwallet-tools-lang | package i | kwalletd5 | package | kwalletd5-debuginfo | package i | kwalletd5-lang | package | kwalletmanager | srcpackage i | kwalletmanager | package | kwalletmanager-debuginfo | package | kwalletmanager-debugsource | package | kwalletmanager5 | srcpackage i | kwalletmanager5 | package | kwalletmanager5-debuginfo | package | kwalletmanager5-debugsource | package i | libkwalletbackend5-5 | package | libkwalletbackend5-5-32bit | package | libkwalletbackend5-5-debuginfo | package | libkwalletbackend5-5-debuginfo-32bit | package i | libsvn_auth_kwallet-1-0 | package | libsvn_auth_kwallet-1-0-debuginfo | package | pam_kwallet | srcpackage | pam_kwallet | package | pam_kwallet-debuginfo | package | pam_kwallet-debugsource | package | qupzilla-kwallet | package | qupzilla-kwallet-debuginfo | package | qupzilla-qt5-kwallet | package | qupzilla-qt5-kwallet-debuginfo | package | signon-kwallet-extension | srcpackage | signon-kwallet-extension | package | signon-kwallet-extension-debuginfo | package | signon-kwallet-extension-debugsource | package -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c17 --- Comment #17 from Marcus Hüwe <suse-tux@gmx.de> --- Assumption: you are using leap 42.1. It seems that the "python-kde4" package is missing. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c18 --- Comment #18 from Ákos Szőts <szotsaki@gmail.com> --- The assumption is correct and python-kde4 package was also missing :). python -c 'import keyring.backends.kwallet.Keyring' returns with: Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named Keyring However, „python -c 'import keyring.backends.kwallet'” returns with nothing and a zero exit status (although I don't know if it's useful). In .oscrc the following is created: [https://api.opensuse.org] keyring=1 user=a When I remove the cookiejar, no password will be asked from me. After I killed "kwalletd" (the KDE 4 one) and an "osc up" KWallet asks for the password again. It seems it works perfectly. Thank you very much for your help! -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=805855 http://bugzilla.novell.com/show_bug.cgi?id=805855#c19 Marcus Hüwe <suse-tux@gmx.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #19 from Marcus Hüwe <suse-tux@gmx.de> --- (In reply to Ákos Szőts from comment #18)
python -c 'import keyring.backends.kwallet.Keyring' returns with: Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named Keyring
However, „python -c 'import keyring.backends.kwallet'” returns with nothing and a zero exit status (although I don't know if it's useful).
Yep, a zero exit status is good:) (the import worked and, hence, osc will use the keyring.backends.kwallet.Keyring class)
It seems it works perfectly. Thank you very much for your help!
Great. Then I'll close this bug. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com