From b24c11b4c390d6315efed595d1f92c2df6602bec Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Wed, 28 Mar 2012 22:00:11 -0400 Subject: 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 --- nova/rootwrap/filters.py | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit