Update KillFilter to handle 'deleted' exe's.
Updates KillFilter so that it handles the case where the executable linked to by /proc/PID/exe is updated or deleted. Fixes LP Bug #967931. Change-Id: I368a01383bf62b64b7579d573b8b84640dec03ae
This commit is contained in:
@@ -117,6 +117,9 @@ class KillFilter(CommandFilter):
|
|||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
command = os.readlink("/proc/%d/exe" % int(args[1]))
|
command = os.readlink("/proc/%d/exe" % int(args[1]))
|
||||||
|
# NOTE(dprince): /proc/PID/exe may have ' (deleted)' on
|
||||||
|
# the end if an executable is updated or deleted
|
||||||
|
command = command.rstrip(" (deleted)")
|
||||||
if command not in self.args[1]:
|
if command not in self.args[1]:
|
||||||
# Affected executable not in accepted list
|
# Affected executable not in accepted list
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user