From b22d0293c0c9d0de1531d1247dc522be816fb1be Mon Sep 17 00:00:00 2001 From: Claire McQuin Date: Fri, 19 Sep 2014 11:48:59 -0700 Subject: Escape path for globbing. --- lib/chef/util/backup.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/chef/util/backup.rb b/lib/chef/util/backup.rb index 43e3434050..0cc009ca1f 100644 --- a/lib/chef/util/backup.rb +++ b/lib/chef/util/backup.rb @@ -16,6 +16,8 @@ # limitations under the License. # +require 'chef/util/path_helper' + class Chef class Util class Backup @@ -77,9 +79,8 @@ class Chef end def sorted_backup_files - Dir[::File.join(prefix, ".#{path}.chef-*")].sort { |a,b| b <=> a } + Dir[Chef::Util::PathHelper.escape_glob(prefix, ".#{path}") + ".chef-*"].sort { |a,b| b <=> a } end end end end - -- cgit v1.2.1