Merge lp:~brian-murray/apport/bug-1300235 into lp:~apport-hackers/apport/trunk

Proposed by Brian Murray
Status: Merged
Merged at revision: 2941
Proposed branch: lp:~brian-murray/apport/bug-1300235
Merge into: lp:~apport-hackers/apport/trunk
Diff against target: 27 lines (+8/-5)
1 file modified
data/apport (+8/-5)
To merge this branch: bzr merge lp:~brian-murray/apport/bug-1300235
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
Review via email: mp+253250@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

This looks good, thanks! Indeed for a simple chroot we must use the host pid, not the guest pid; the latter would need actually entering the guest namespace.

review: Approve

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 2014-12-02 09:47:58 +0000
3+++ data/apport 2015-03-17 18:25:28 +0000
4@@ -266,15 +266,18 @@
5 # apport can't be found, then simply log an entry in the host error log
6 # and exit 0.
7 if len(sys.argv) == 5 and sys.argv[4].isdigit() and sys.argv[4] != sys.argv[1]:
8- if os.path.exists('/proc/%s/root/%s' % (sys.argv[4], __file__)):
9+ host_pid = sys.argv[4]
10+ pid = sys.argv[1]
11+ if os.path.exists('/proc/%s/root/%s' % (host_pid, __file__)):
12 error_log('pid %s (host pid %s) crashed in a container with apport '
13- 'support, forwarding' % (sys.argv[1], sys.argv[4]))
14+ 'support, forwarding' % (pid, host_pid))
15 sys.stderr.flush()
16- os.execv('/usr/sbin/chroot', ('chroot', '/proc/%s/root/' % sys.argv[4],
17- __file__, sys.argv[1], sys.argv[2],
18+ os.execv('/usr/sbin/chroot', ('chroot', '/proc/%s/root/' % host_pid,
19+ __file__, host_pid, sys.argv[2],
20 sys.argv[3]))
21 else:
22- error_log('pid %s crashed in a container without apport support' % sys.argv[4])
23+ error_log('host pid %s crashed in a container without apport support' %
24+ host_pid)
25 sys.exit(0)
26
27 check_lock()

Subscribers

People subscribed via source and target branches