~ubuntu-branches/ubuntu/trusty/puppet/trusty

« back to all changes in this revision

Viewing changes to lib/puppet/file_serving/indirection_hooks.rb

  • Committer: Package Import Robot
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2011-10-22 14:08:22 UTC
  • mfrom: (1.1.25) (3.1.32 sid)
  • Revision ID: package-import@ubuntu.com-20111022140822-odxde5lohc45yhuz
Tags: 2.7.6-1
* New upstream release (CVE-2011-3872)
* Remove cherry-picked "groupadd_aix_warning" patch
* Install all new manpages

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
#  Created by Luke Kanies on 2007-10-18.
3
 
#  Copyright (c) 2007. All rights reserved.
4
 
 
5
1
require 'uri'
6
2
require 'puppet/file_serving'
 
3
require 'puppet/util'
7
4
 
8
5
# This module is used to pick the appropriate terminus
9
6
# in file-serving indirections.  This is necessary because
16
13
    # We rely on the request's parsing of the URI.
17
14
 
18
15
    # Short-circuit to :file if it's a fully-qualified path or specifies a 'file' protocol.
19
 
    return PROTOCOL_MAP["file"] if request.key =~ /^#{::File::SEPARATOR}/
 
16
    return PROTOCOL_MAP["file"] if Puppet::Util.absolute_path?(request.key)
20
17
    return PROTOCOL_MAP["file"] if request.protocol == "file"
21
18
 
22
19
    # 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'