diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-01-25 22:24:20 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-01-25 22:24:20 +0000 |
| commit | 5c51ee01e2657cd2af1edf8ce8a3b52ba5d95374 (patch) | |
| tree | ec458d311e4728a0772e2764adcb9b3440ed1d12 | |
| parent | 01a9d86e872c9ef1805b9b56590418d75c4ab440 (diff) | |
| parent | 78c68b84dfc22eec233a607a6b596602487799d7 (diff) | |
Merge "rootwrap: Fix KillFilter matching"
| -rwxr-xr-x | nova/rootwrap/filters.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/nova/rootwrap/filters.py b/nova/rootwrap/filters.py index 05eaf7676..d16fc9a57 100755 --- a/nova/rootwrap/filters.py +++ b/nova/rootwrap/filters.py @@ -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]: |
