pydoc complains it cant get into my gnome-keyring

Bug #1077533 reported by Moses Moore
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
urlgrabber (Ubuntu)
New
Undecided
Unassigned

Bug Description

$ pydoc -k cheezburger
No handlers could be found for logger "OpenGL.Tk"
WARNING: gnome-keyring:: couldn't connect to: /run/user/moses/keyring-XXXXXX/pkcs11: No such file or directory

I can't only think of one good and not-scary reason why pydoc needs my authentication credentials when it should be searching text files on the local harddrive -- if I had an network filesystem on autofs somewhere in Python's sys.path -- but I do not.

I expect pydoc's '-k' would search the .__doc__ for modules in the following directories:

$ python -c 'import sys; print repr(sys.path)' |sed 's/, /,\n /g'
['',
 '/usr/local/lib/python2.7/dist-packages/PyAMF-0.6.1-py2.7-linux-i686.egg',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PIL',
 '/usr/lib/python2.7/dist-packages/gst-0.10',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/pymodules/python2.7',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode']

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: python 2.7.3-0ubuntu7
ProcVersionSignature: Ubuntu 3.5.0-17.28-generic 3.5.5
Uname: Linux 3.5.0-17-generic i686
NonfreeKernelModules: nvidia
ApportVersion: 2.6.1-0ubuntu6
Architecture: i386
Date: Sat Nov 10 20:18:08 2012
MarkForUpload: True
SourcePackage: python-defaults
UpgradeStatus: Upgraded to quantal on 2012-10-19 (22 days ago)

Revision history for this message
Moses Moore (moses-mozai) wrote :
Revision history for this message
Moses Moore (moses-mozai) wrote :

attaching a systrace. Nothing pops out as obvious. The reading bytes from /dev/urandom might be for some encryption purpose related to whyever pydoc needs to get into my Gnome-keyring, but again, I can't think of a not-scary reason why something that should be reading and parsing text files needs to authorize with some third-party with my identity.

strace pydoc -k cheezburger 2>/tmp/strace.log

I'll try removing some python packages, like PyAMF and ubuntu-sso, to see if it makes a difference.

Revision history for this message
Andrey Bondarenko (abone) wrote :

Are you using non-GNOME desktop? This bug is probably duplicate of bug 932177

Revision history for this message
Moses Moore (moses-mozai) wrote :

Yes, I'm using a non-GNOME desktop. No, this is not a duplicate bug; if that other bug is solved it would only obfuscate this bug.

My concern is that an application that should walk through only local unencrypted files is asking for access to the GNOME keyring. I expect the GNOME keyring is only needed for private and personal information, and pydoc should be accessing python modules that are not encrypted for my use only, nor are hosted by some remote gatekeeper asking for proof of my identity.

I would be very upset if, when attempting to read a book cover on my living room bookshelf, the bookshelf carps at me that it can't find my wallet. Fixing bug 932177 may permit my bookshelf to rifle through my wallet... when my wallet should be irrelevant to the entire exercise.

Revision history for this message
Andrey Bondarenko (abone) wrote :

Thank you. Now I see that this bug is not a duplicate.

I agree, that accessing keyring without a reason is rather scary behaviour, but you probably assigned the bug to a wrong package. AFAIK any application that loads keyring related library automagicaly tries to access your keyring.

From your strace:

$ zcat strace.log.gz | grep keyr | grep -v ENOENT | grep \\.so
open("/usr/lib/python2.7/dist-packages/gtk-2.0/gnomekeyring.so", O_RDONLY|O_LARGEFILE) = 8
open("/usr/lib/i386-linux-gnu/libgnome-keyring.so.0", O_RDONLY|O_CLOEXEC) = 11
open("/usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so", O_RDONLY|O_CLOEXEC) = 12

Pydoc imports modules to get docsrtings. I suppose, some module that you trying to process loads keyring libaries on import and you see the warning, but it looks like a feature, not a bug.

Revision history for this message
Moses Moore (moses-mozai) wrote :

I removed packag 'python-gnomekeyring'

$ dpkg -S /usr/lib/python2.7/dist-packages/gtk-2.0/gnomekeyring.sopython-gnomekeyring: /usr/lib/python2.7/dist-packages/gtk-2.0/gnomekeyring.so
$ sudo dpkg -r python-gnomekeyring

$ pydoc -k cheezburger
WARNING: gnome-keyring:: couldn't connect to: /run/user/moses/keyring-thWOug/pkcs11: No such file or directory

... something is still trying to get into my keyring.
$ cat /tmp/strace.log | grep keyr | grep -v ENOENT | grep \\.so
open("/usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so", O_RDONLY|O_CLOEXEC) = 12

Based on your last comment, I used `</tmp/strace.log egrep '^open' |grep -v ENOENT |less` to get a better idea of what python modules could be asking for gnome keyring access during some python importing automagic.

open("/usr/lib/python2.7/dist-packages/uno.py", O_RDONLY|O_LARGEFILE) = 3
open("/usr/lib/python2.7/dist-packages/unohelper.py", O_RDONLY|O_LARGEFILE) = 3
openat(AT_FDCWD, "/usr/lib/python2.7/dist-packages/urlgrabber", O_RDONLY|O_NONBL
OCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3
open("/usr/lib/python2.7/dist-packages/urlgrabber/__init__.py", O_RDONLY|O_LARGE
FILE) = 3
open("/usr/lib/python2.7/dist-packages/urlgrabber/__init__.py", O_RDONLY|O_LARGE
FILE) = 3
open("/usr/lib/python2.7/dist-packages/urlgrabber/__init__.py", O_RDONLY|O_LARGE
FILE) = 3
open("/usr/lib/python2.7/dist-packages/urlgrabber/__init__.pyc", O_RDONLY|O_LARG
EFILE) = 5
open("/usr/lib/python2.7/dist-packages/urlgrabber/grabber.py", O_RDONLY|O_LARGEF
ILE) = 5
open("/usr/lib/python2.7/dist-packages/urlgrabber/grabber.pyc", O_RDONLY|O_LARGE
FILE) = 11
open("/usr/lib/python2.7/dist-packages/urlgrabber/byterange.py", O_RDONLY|O_LARG
EFILE) = 11
open("/usr/lib/python2.7/dist-packages/urlgrabber/byterange.pyc", O_RDONLY|O_LAR
GEFILE) = 12
open("/dev/urandom", O_RDONLY) = 11
openat(AT_FDCWD, "/etc/pkcs11/modules", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECT
ORY|O_CLOEXEC) = 12
open("/etc/pkcs11/modules/gnome-keyring.module", O_RDONLY) = 14
open("/usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so", O_RDONLY|O_CLOEXEC) = 12

I'll try removing python-urlgrabber as well and re-run the test. ... and **pass**.

NEW steps to reproduce the problem:
$ pydoc -k cheezburger
(no output)
$ sudo apt-get install python-urlgrabber
$ pydoc -k cheezburger
WARNING: gnome-keyring:: couldn't connect to: /run/user/moses/keyring-thWOug/pkcs11: No such file or directory
$ sudo dpkg -r python-urlgrabber
$ pydoc -k cheezburger
(no output)

Someone close this bug -- I'll file a new one against python-urlgrabber.

Revision history for this message
Andrey Bondarenko (abone) wrote :

You don't need to file another bug. I've reassigned this bug to urlgrabber, you can update it's decription.

affects: python-defaults (Ubuntu) → urlgrabber (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.