summaryrefslogtreecommitdiff
path: root/lib/chef/knife/core/bootstrap_context.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/knife/core/bootstrap_context.rb')
-rw-r--r--lib/chef/knife/core/bootstrap_context.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb
index 87c25ca160..03e3a42e4a 100644
--- a/lib/chef/knife/core/bootstrap_context.rb
+++ b/lib/chef/knife/core/bootstrap_context.rb
@@ -17,6 +17,8 @@
#
require 'chef/run_list'
+require 'chef/util/path_helper'
+
class Chef
class Knife
module Core
@@ -167,7 +169,7 @@ CONFIG
def trusted_certs_content
content = ""
if @chef_config[:trusted_certs_dir]
- Dir.glob(File.join(@chef_config[:trusted_certs_dir], "*.{crt,pem}")).each do |cert|
+ Dir.glob(File.join(Chef::Util::PathHelper.escape_glob(@chef_config[:trusted_certs_dir]), "*.{crt,pem}")).each do |cert|
content << "cat > /etc/chef/trusted_certs/#{File.basename(cert)} <<'EOP'\n" +
IO.read(File.expand_path(cert)) + "\nEOP\n"
end