summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaire McQuin <claire@getchef.com>2014-09-19 11:57:50 -0700
committerClaire McQuin <claire@getchef.com>2014-09-22 11:22:29 -0700
commitc3216811254bd98d0e70772ea54a2dc53e9e0b3a (patch)
treedde4818db9c93f7363578fa022b8993de55bc66f
parent1393427cf7e3a871eea314c6e683299e2c48e648 (diff)
downloadchef-c3216811254bd98d0e70772ea54a2dc53e9e0b3a.tar.gz
Escape path for globbing.
-rw-r--r--lib/chef/knife/core/object_loader.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/chef/knife/core/object_loader.rb b/lib/chef/knife/core/object_loader.rb
index de683b23fd..4ba41c53c3 100644
--- a/lib/chef/knife/core/object_loader.rb
+++ b/lib/chef/knife/core/object_loader.rb
@@ -71,13 +71,13 @@ class Chef
def find_all_objects(path)
path = File.join(path, '*')
path << '.{json,rb}'
- objects = Dir.glob(File.expand_path(path))
+ objects = Dir.glob(Chef::Util::PathHelper.escape_glob(File.expand_path(path)))
objects.map { |o| File.basename(o) }
end
def find_all_object_dirs(path)
path = File.join(path, '*')
- objects = Dir.glob(File.expand_path(path))
+ objects = Dir.glob(Chef::Util::PathHelper.escape_glob(File.expand_path(path)))
objects.delete_if { |o| !File.directory?(o) }
objects.map { |o| File.basename(o) }
end
@@ -111,4 +111,3 @@ class Chef
end
end
end
-