From e1c6bef68597f5c4f418107ef9e3638e44cc8cf7 Mon Sep 17 00:00:00 2001 From: John Keiser <jkeiser@opscode.com> Date: Tue, 15 Oct 2013 20:41:52 -0700 Subject: Add --config-file-jail to avoid loading user knife.rb in tests --- lib/chef/application/client.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/chef/application/client.rb') diff --git a/lib/chef/application/client.rb b/lib/chef/application/client.rb index ea8d599b4c..0964101fad 100644 --- a/lib/chef/application/client.rb +++ b/lib/chef/application/client.rb @@ -206,6 +206,10 @@ class Chef::Application::Client < Chef::Application :long => "--chef-zero-port PORT", :description => "Port to start chef-zero on" + option :config_file_jail, + :long => "--config-file-jail PATH", + :description => "Directory under which config files are allowed to be loaded (no client.rb or knife.rb outside this path will be loaded)." + if Chef::Platform.windows? option :fatal_windows_admin_check, :short => "-A", @@ -272,6 +276,7 @@ class Chef::Application::Client < Chef::Application end def load_config_file + Chef::Config.config_file_jail = config[:config_file_jail] if config[:config_file_jail] if !config.has_key?(:config_file) if config[:local_mode] require 'chef/knife' -- cgit v1.2.1