diff options
author | Claire McQuin <claire@getchef.com> | 2014-09-19 11:52:35 -0700 |
---|---|---|
committer | Claire McQuin <claire@getchef.com> | 2014-09-22 11:22:29 -0700 |
commit | da3966873a32b5e966d1caf404bb87d56cd1d807 (patch) | |
tree | 15dd8545ba940f77c0b3215097a9befd7eb53295 | |
parent | b22d0293c0c9d0de1531d1247dc522be816fb1be (diff) | |
download | chef-da3966873a32b5e966d1caf404bb87d56cd1d807.tar.gz |
Escape path for globbing.
-rw-r--r-- | lib/chef/deprecation/provider/file.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/deprecation/provider/file.rb b/lib/chef/deprecation/provider/file.rb index 0e9105247c..125f31fe10 100644 --- a/lib/chef/deprecation/provider/file.rb +++ b/lib/chef/deprecation/provider/file.rb @@ -16,6 +16,7 @@ # limitations under the License. # +require 'chef/util/path_helper' class Chef module Deprecation @@ -180,7 +181,7 @@ class Chef # Clean up after the number of backups slice_number = @new_resource.backup - backup_files = Dir[::File.join(prefix, ".#{@new_resource.path}.chef-*")].sort { |a,b| b <=> a } + backup_files = Dir[Chef::Util::PathHelper.escape_glob(prefix, ".#{@new_resource.path}") + ".chef-*"].sort { |a,b| b <=> a } if backup_files.length >= @new_resource.backup remainder = backup_files.slice(slice_number..-1) remainder.each do |backup_to_delete| |