Insuffisient permissions make apport-gtk crash with KeyError in __getitem__()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apport (Ubuntu) |
Fix Released
|
Undecided
|
Martin Pitt |
Bug Description
Binary package hint: apport
Bug #129146 is about handling the case when the crash report is not readable. Bug #198526 is about the case when it is readable but not writable.
I stumbled upon yet another bug in apport where it crashes while processing a report that is both readable and writable but is not owned by the current user. After the crash the original report is *destroyed*. The file is truncated to zero length.
How to reproduce:
1. Crash a program running with root privileges. I used bug #67995 to crash Synaptic.
2. Find the newly created report in /var/crash and change its group and permissions so that it is readable and writable by your current user, but root is still the owner:
$ cd /var/crash
$ ls -l _usr_sbin_
-rw------- 1 root root 5152387 2008-03-05 02:23 _usr_sbin_
$ sudo chgrp username _usr_sbin_
$ sudo chmod g+rw _usr_sbin_
3. Open the crash report under your current user. Apport will crash.
4. The original crash report is now erased:
$ ls -l _usr_sbin_
-rw-rw---- 1 root username 0 2008-03-05 03:30 _usr_sbin_
Step one can actually be omitted, but this scenario is intended to show how you can run into this problem in real life. When I did, I didn't realize that it was not enough to give apport read and write permissions to the crash report in order to send it.
The traceback for this bug coincides with that of bug #147113. I don't know whether they are the same problem or two different problems with similar symptoms.
As for bug #151678, which is a duplicate of #147113, please note the unusual permissions of the report that caused apport to crash: <http://
0:0:0:0:2007-10-11 12:51:04.000000000 -0700:2007-10-11 12:56:38.000000000 -0700:/
The mode is 0, nobody has any permissions for that file.
Hope this helps.
ProblemType: Crash
Architecture: i386
CrashReports:
660:0:
600:1001:
Date: Wed Mar 5 03:30:44 2008
DistroRelease: Ubuntu 7.10
ExecutablePath: /usr/share/
InterpreterPath: /usr/bin/python2.5
Package: apport-gtk 0.98
PackageArchitec
ProcCmdline: /usr/bin/python /usr/share/
ProcCwd: /home/users/alexkon
ProcEnviron:
PATH=/
LANG=en_US.UTF-8
SHELL=/bin/bash
PythonArgs: ['/usr/
SourcePackage: apport
Title: apport-gtk crashed with KeyError in __getitem__()
Uname: Linux chronos 2.6.22-14-generic #1 SMP Tue Feb 12 07:42:25 UTC 2008 i686 GNU/Linux
trunk r1545