summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorJosh Cooper <josh@puppetlabs.com>2011-07-18 22:44:10 -0700
committerJosh Cooper <josh@puppetlabs.com>2011-07-19 14:03:42 -0700
commit45ae5b4a9ced26dfcd3e324391f9a26cb02bf93d (patch)
treeb61ccc5270617529b3e7113b2356f882ab53cb38 /lib/puppet/parser
parent26ee468e8b963d63933d9a27a65d55510ff87618 (diff)
downloadpuppet-45ae5b4a9ced26dfcd3e324391f9a26cb02bf93d.tar.gz
puppet-45ae5b4a9ced26dfcd3e324391f9a26cb02bf93d.tar.xz
puppet-45ae5b4a9ced26dfcd3e324391f9a26cb02bf93d.zip
(#8268) Require windows drive letters in absolute file paths
When testing whether a file path is absolute, the regexp was only handling POSIX style file paths. This commit requires Windows style file paths to start with a drive letter. A future commit will refacter the various places we do path validation to support both Windows drive letters and UNC paths. Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/type_loader.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/puppet/parser/type_loader.rb b/lib/puppet/parser/type_loader.rb
index 1fba73d0b..68def068d 100644
--- a/lib/puppet/parser/type_loader.rb
+++ b/lib/puppet/parser/type_loader.rb
@@ -80,7 +80,8 @@ class Puppet::Parser::TypeLoader
loaded_asts = []
files.each do |file|
- unless file =~ /^#{File::SEPARATOR}/
+ regex = Puppet.features.microsoft_windows? ? /^[A-Za-z]:#{File::SEPARATOR}/ : /^#{File::SEPARATOR}/
+ unless file =~ regex
file = File.join(dir, file)
end
@loading_helper.do_once(file) do