diff -u apport-2.20.4/data/apport apport-2.20.4/data/apport --- apport-2.20.4/data/apport +++ apport-2.20.4/data/apport @@ -15,6 +15,7 @@ import sys, os, os.path, subprocess, time, traceback, pwd, io import signal, inspect, grp, fcntl, socket, atexit, array, struct +import errno import apport, apport.fileutils @@ -298,13 +299,20 @@ def is_same_ns(pid, ns): - if not os.path.exists('/proc/self/ns/%s' % ns): + if not os.path.exists('/proc/self/ns/%s' % ns) or \ + not os.path.exists('/proc/%s/ns/%s' % (pid, ns)): # If the namespace doesn't exist, then it's obviously shared return True - if os.readlink('/proc/%s/ns/%s' % (pid, ns)) == os.readlink('/proc/self/ns/%s' % ns): - # Check that the inode for both namespaces is the same - return True + try: + if os.readlink('/proc/%s/ns/%s' % (pid, ns)) == os.readlink('/proc/self/ns/%s' % ns): + # Check that the inode for both namespaces is the same + return True + except OSError as e: + if e.errno == errno.ENOENT: + pass + else: + raise return False diff -u apport-2.20.4/debian/changelog apport-2.20.4/debian/changelog --- apport-2.20.4/debian/changelog +++ apport-2.20.4/debian/changelog @@ -1,3 +1,11 @@ +apport (2.20.4-0ubuntu4.10) zesty-security; urgency=medium + + * data/apport: add a second os.path.exists check to ensure we do not + receive a Traceback in is_container_id() and add an exception handler in + case either name space can not be found. (LP: #1733366) + + -- Brian Murray Wed, 13 Dec 2017 10:51:39 -0800 + apport (2.20.4-0ubuntu4.9) zesty; urgency=medium * bin/apport-cli: read until instead of a single character when # of