diff options
-rw-r--r-- | lib/chef/file_cache.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/chef/file_cache.rb b/lib/chef/file_cache.rb index 89e934ea05..c2f77bdff6 100644 --- a/lib/chef/file_cache.rb +++ b/lib/chef/file_cache.rb @@ -20,6 +20,7 @@ require 'chef/mixin/create_path' require 'chef/exceptions' require 'chef/json_compat' require 'fileutils' +require 'chef/util/path_helper' class Chef class FileCache @@ -157,9 +158,9 @@ class Chef # [String] - An array of file cache keys matching the glob def find(glob_pattern) keys = Array.new - Dir[File.join(file_cache_path, glob_pattern)].each do |f| + Dir[File.join(Chef::Util::PathHelper.escape_glob(file_cache_path), glob_pattern)].each do |f| if File.file?(f) - keys << f[/^#{Regexp.escape(Dir[file_cache_path].first) + File::Separator}(.+)/, 1] + keys << f[/^#{Regexp.escape(Dir[Chef::Util::PathHelper.escape_glob(file_cache_path)].first) + File::Separator}(.+)/, 1] end end keys |