Skip to content

Commit

Permalink
Merge "rootwrap: Fix KillFilter matching" into milestone-proposed
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Jan 26, 2012
2 parents 0f11654 + ff3cd80 commit 547c771
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nova/rootwrap/filters.py
Expand Up @@ -100,19 +100,20 @@ class KillFilter(CommandFilter):
"""

def match(self, userargs):
if len(userargs) == 3:
signal = userargs.pop(1)
args = list(userargs)
if len(args) == 3:
signal = args.pop(1)
if signal not in self.args[0]:
# Requested signal not in accepted list
return False
else:
if len(userargs) != 2:
if len(args) != 2:
# Incorrect number of arguments
return False
if '' not in self.args[0]:
# No signal, but list doesn't include empty string
return False
pid = userargs[1]
pid = int(args[1])
try:
command = os.readlink("/proc/%d/exe" % pid)
if command not in self.args[1]:
Expand Down

0 comments on commit 547c771

Please sign in to comment.