diff options
author | Jacob Helwig <jacob@puppetlabs.com> | 2011-08-02 11:04:26 -0700 |
---|---|---|
committer | Jacob Helwig <jacob@puppetlabs.com> | 2011-08-02 16:33:52 -0700 |
commit | 568d25ee10effd5e87c57cdc8c24280eabf9cd93 (patch) | |
tree | 172d4447cc0b44821dd898d029b56f8f3e3ac2d8 /lib/puppet/file_serving/indirection_hooks.rb | |
parent | 3aec02ba0e4bda8ba4e9fffbc6defaae4e4e2ba1 (diff) | |
download | puppet-568d25ee10effd5e87c57cdc8c24280eabf9cd93.tar.gz puppet-568d25ee10effd5e87c57cdc8c24280eabf9cd93.tar.xz puppet-568d25ee10effd5e87c57cdc8c24280eabf9cd93.zip |
Treat Windows absolute paths as absolute paths
Previously, we only considered files that matched the *nix concept of
'absolute' as being absolute paths. Since absolute paths on Windows
look more like URLs with this world-view, we need to specifically look
for the Windows absolute paths, and treat them as such.
We will still treat *nix absolute paths as absolute on Windows, even
though they are actually relative to the "current" drive. We do not
currently limit which "style" of absolute path is allowed based on
what the agent is.
Reviewed-by: Nick Lewis <nick@puppetlabs.com>
Diffstat (limited to 'lib/puppet/file_serving/indirection_hooks.rb')
-rw-r--r-- | lib/puppet/file_serving/indirection_hooks.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/puppet/file_serving/indirection_hooks.rb b/lib/puppet/file_serving/indirection_hooks.rb index a85e90ef1..2a0dc1792 100644 --- a/lib/puppet/file_serving/indirection_hooks.rb +++ b/lib/puppet/file_serving/indirection_hooks.rb @@ -17,6 +17,7 @@ module Puppet::FileServing::IndirectionHooks # Short-circuit to :file if it's a fully-qualified path or specifies a 'file' protocol. return PROTOCOL_MAP["file"] if request.key =~ /^#{::File::SEPARATOR}/ + return PROTOCOL_MAP["file"] if request.key =~ /^[a-z]:[\/\\]/i return PROTOCOL_MAP["file"] if request.protocol == "file" # We're heading over the wire the protocol is 'puppet' and we've got a server name or we're not named 'apply' or 'puppet' |