From 37f87b709598b48bc8b562422da27cc73cc1eff1 Mon Sep 17 00:00:00 2001 From: Jacob Helwig Date: Tue, 2 Aug 2011 11:04:26 -0700 Subject: 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 (cherry picked from commit 568d25ee10effd5e87c57cdc8c24280eabf9cd93) --- lib/puppet/file_serving/indirection_hooks.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/puppet/file_serving/indirection_hooks.rb') diff --git a/lib/puppet/file_serving/indirection_hooks.rb b/lib/puppet/file_serving/indirection_hooks.rb index 499767c41..bdcc8865e 100644 --- a/lib/puppet/file_serving/indirection_hooks.rb +++ b/lib/puppet/file_serving/indirection_hooks.rb @@ -13,6 +13,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' -- cgit