diff options
author | David Schmitt <david@dasz.at> | 2010-04-30 11:34:52 +0200 |
---|---|---|
committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
commit | 97c043f440115fcfd9d3ddaad59af5c8da875329 (patch) | |
tree | 8839b56dd3713b69e88b82f2031e41857615bc18 /lib/puppet/type/file.rb | |
parent | f80b4c73bb17af8b103cbc2562f8617755e93d3f (diff) | |
download | puppet-97c043f440115fcfd9d3ddaad59af5c8da875329.tar.gz puppet-97c043f440115fcfd9d3ddaad59af5c8da875329.tar.xz puppet-97c043f440115fcfd9d3ddaad59af5c8da875329.zip |
Fix path handling
*) Use File.expand_path as indicator for being an absolute path
*) Use basename instead of parsing the path manually
Diffstat (limited to 'lib/puppet/type/file.rb')
-rw-r--r-- | lib/puppet/type/file.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb index 2e249ad41..51865ef49 100644 --- a/lib/puppet/type/file.rb +++ b/lib/puppet/type/file.rb @@ -29,7 +29,8 @@ Puppet::Type.newtype(:file) do isnamevar validate do |value| - unless value =~ /^#{File::SEPARATOR}/ + # use underlying platform's convention to check for relative paths + unless File.expand_path(value) == value fail Puppet::Error,"File paths must be fully qualified, not '#{value}'" end end |