summaryrefslogtreecommitdiffstats
path: root/openstack/common/rootwrap/wrapper.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-06-26 02:13:59 +0000
committerGerrit Code Review <review@openstack.org>2013-06-26 02:13:59 +0000
commit18dc396748114e5d8af0a9f84ba944e532815b65 (patch)
tree954856ef7b4f6cb841d9edcfca6b6be1352c6633 /openstack/common/rootwrap/wrapper.py
parent5229aca95f5c29b81bf423fcf438cc7223fa22ad (diff)
parent3e74c0017e0b1ab209bc066cc0cec6c151b69b83 (diff)
downloadoslo-18dc396748114e5d8af0a9f84ba944e532815b65.tar.gz
oslo-18dc396748114e5d8af0a9f84ba944e532815b65.tar.xz
oslo-18dc396748114e5d8af0a9f84ba944e532815b65.zip
Merge "Add IpFilter, IPNetnsExecFilter and EnvFilter"
Diffstat (limited to 'openstack/common/rootwrap/wrapper.py')
-rw-r--r--openstack/common/rootwrap/wrapper.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/openstack/common/rootwrap/wrapper.py b/openstack/common/rootwrap/wrapper.py
index 5390c1b..df1a9f4 100644
--- a/openstack/common/rootwrap/wrapper.py
+++ b/openstack/common/rootwrap/wrapper.py
@@ -131,6 +131,20 @@ def match_filter(filter_list, userargs, exec_dirs=[]):
for f in filter_list:
if f.match(userargs):
+ if isinstance(f, filters.ChainingFilter):
+ # This command calls exec verify that remaining args
+ # matches another filter.
+ def non_chain_filter(fltr):
+ return (fltr.run_as == f.run_as
+ and not isinstance(fltr, filters.ChainingFilter))
+
+ leaf_filters = [fltr for fltr in filter_list
+ if non_chain_filter(fltr)]
+ args = f.exec_args(userargs)
+ if (not args or not match_filter(leaf_filters,
+ args, exec_dirs=exec_dirs)):
+ continue
+
# Try other filters if executable is absent
if not f.get_exec(exec_dirs=exec_dirs):
if not first_not_executable_filter: