summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaire McQuin <claire@getchef.com>2014-09-19 11:55:23 -0700
committerClaire McQuin <claire@getchef.com>2014-09-22 11:22:29 -0700
commit1393427cf7e3a871eea314c6e683299e2c48e648 (patch)
tree8e9c4500e9e8ebcbf74355dbe98f3ed853eb302c
parentda3966873a32b5e966d1caf404bb87d56cd1d807 (diff)
downloadchef-1393427cf7e3a871eea314c6e683299e2c48e648.tar.gz
Escape path for globbing.
-rw-r--r--lib/chef/knife.rb1
-rw-r--r--lib/chef/knife/core/bootstrap_context.rb2
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/knife.rb b/lib/chef/knife.rb
index 6421384f01..377d3841d8 100644
--- a/lib/chef/knife.rb
+++ b/lib/chef/knife.rb
@@ -28,6 +28,7 @@ require 'chef/knife/core/ui'
require 'chef/local_mode'
require 'chef/rest'
require 'pp'
+require 'chef/util/path_helper'
class Chef
class Knife
diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb
index 87c25ca160..2b3d2c53a8 100644
--- a/lib/chef/knife/core/bootstrap_context.rb
+++ b/lib/chef/knife/core/bootstrap_context.rb
@@ -167,7 +167,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