summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2012-03-28 22:00:11 -0400
committerDan Prince <dprince@redhat.com>2012-03-28 22:00:11 -0400
commitb24c11b4c390d6315efed595d1f92c2df6602bec (patch)
treeb4621ded0ebfdc02ed96cb24e4348cf313c3ae62
parent998e57b29629946a9da96db3aed013ab895dc482 (diff)
downloadnova-b24c11b4c390d6315efed595d1f92c2df6602bec.tar.gz
nova-b24c11b4c390d6315efed595d1f92c2df6602bec.tar.xz
nova-b24c11b4c390d6315efed595d1f92c2df6602bec.zip
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
-rwxr-xr-xnova/rootwrap/filters.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/rootwrap/filters.py b/nova/rootwrap/filters.py
index a8fd5139b..566c03b56 100755
--- a/nova/rootwrap/filters.py
+++ b/nova/rootwrap/filters.py
@@ -117,6 +117,9 @@ class KillFilter(CommandFilter):
return False
try:
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]:
# Affected executable not in accepted list
return False