Merge lp:~ev/apport/whoopsie into lp:~apport-hackers/apport/trunk

Proposed by Evan
Status: Merged
Merged at revision: 2170
Proposed branch: lp:~ev/apport/whoopsie
Merge into: lp:~apport-hackers/apport/trunk
Diff against target: 27 lines (+8/-2)
1 file modified
data/apport (+8/-2)
To merge this branch: bzr merge lp:~ev/apport/whoopsie
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
Review via email: mp+94390@code.launchpad.net

Description of the change

This fixes the issue apw raised in #ubuntu-devel, wherein apport is creating report files that are group owned by the affected user, rather than whoopsie.

To post a comment you must log in.
lp:~ev/apport/whoopsie updated
2167. By Martin Pitt

launchpad.py: Fix crash on unicode report titles. (LP: #896626)

2168. By Martin Pitt

launchpad.py: typo fix

2169. By Martin Pitt

release 1.93

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks!

review: Approve
lp:~ev/apport/whoopsie updated
2170. By Martin Pitt

apport: Set the group of written reports to "whoopsie" if that group exists.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/apport'
2--- data/apport 2012-01-16 09:22:35 +0000
3+++ data/apport 2012-02-23 14:59:17 +0000
4@@ -13,7 +13,7 @@
5 # option) any later version. See http://www.gnu.org/copyleft/gpl.html for
6 # the full text of the license.
7
8-import sys, os, os.path, subprocess, time, traceback, tempfile, glob
9+import sys, os, os.path, subprocess, time, traceback, tempfile, glob, pwd
10 import signal, inspect, grp, fcntl
11
12 import apport, apport.fileutils
13@@ -346,7 +346,13 @@
14 reportfile = os.fdopen(os.open(report,
15 os.O_WRONLY|os.O_CREAT|os.O_EXCL, 0), 'w')
16 assert reportfile.fileno() > sys.stderr.fileno()
17- os.chown(report, pidstat.st_uid, pidstat.st_gid)
18+ whoopsie_gid = pwd.getpwnam('whoopsie')
19+ if whoopsie_gid:
20+ # Make sure the crash reporting daemon can read this report
21+ whoopsie_gid = whoopsie_gid.pw_gid
22+ os.chown(report, pidstat.st_uid, whoopsie_gid)
23+ else:
24+ os.chown(report, pidstat.st_uid, pidstat.st_gid)
25 except (OSError, IOError) as e:
26 error_log('Could not create report file: %s' % str(e))
27 sys.exit(1)

Subscribers

People subscribed via source and target branches