~ubuntu-branches/ubuntu/quantal/puppet/quantal-security

« back to all changes in this revision

Viewing changes to lib/puppet/network/client/proxy.rb

  • Committer: Bazaar Package Importer
  • Author(s): Marc Deslauriers
  • Date: 2011-10-24 15:05:12 UTC
  • Revision ID: james.westby@ubuntu.com-20111024150512-yxqwfdp6hcs6of5l
Tags: 2.7.1-1ubuntu3.2
* SECURITY UPDATE: puppet master impersonation via incorrect certificates
  - debian/patches/CVE-2011-3872.patch: refactor certificate handling.
  - Thanks to upstream for providing the patch.
  - CVE-2011-3872

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# unlike the other client classes (again, this design sucks) this class
2
 
# is basically just a proxy class -- it calls its methods on the driver
3
 
# and that's about it
4
 
class Puppet::Network::Client::ProxyClient < Puppet::Network::Client
5
 
  def self.mkmethods
6
 
    interface = self.handler.interface
7
 
    namespace = interface.prefix
8
 
 
9
 
 
10
 
    interface.methods.each { |ary|
11
 
      method = ary[0]
12
 
      Puppet.debug "#{self}: defining #{namespace}.#{method}"
13
 
      define_method(method) { |*args|
14
 
        begin
15
 
          @driver.send(method, *args)
16
 
        rescue XMLRPC::FaultException => detail
17
 
          #Puppet.err "Could not call %s.%s: %s" %
18
 
          #    [namespace, method, detail.faultString]
19
 
          #raise NetworkClientError,
20
 
          #    "XMLRPC Error: #{detail.faultString}"
21
 
          raise NetworkClientError, detail.faultString
22
 
        end
23
 
      }
24
 
    }
25
 
  end
26
 
end
27