From cdd1e6e19e7b8fc340ebcf543a30564c76e71eb9 Mon Sep 17 00:00:00 2001 From: luke Date: Sat, 9 Dec 2006 16:40:50 +0000 Subject: Another intermediate commit. Most of the graphing work itself is now done, but I am in the middle of converting files to use the graphs and at the same time am writing some actually decent tests for the file recursion stuff. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1899 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/server/authstore.rb | 3 +++ lib/puppet/server/fileserver.rb | 17 +++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'lib/puppet/server') diff --git a/lib/puppet/server/authstore.rb b/lib/puppet/server/authstore.rb index 3e7881162..b0f63b68a 100755 --- a/lib/puppet/server/authstore.rb +++ b/lib/puppet/server/authstore.rb @@ -28,6 +28,9 @@ class Server def allowed?(name, ip) if name or ip + # This is probably unnecessary, and can cause some weirdnesses in + # cases where we're operating over localhost but don't have a real + # IP defined. unless name and ip raise Puppet::DevError, "Name and IP must be passed to 'allowed?'" end diff --git a/lib/puppet/server/fileserver.rb b/lib/puppet/server/fileserver.rb index 8033fac5b..53c60cdbe 100755 --- a/lib/puppet/server/fileserver.rb +++ b/lib/puppet/server/fileserver.rb @@ -126,6 +126,10 @@ class Server sub.join("\t") }.join("\n") end + + def local? + self.local + end # Mount a new directory with a name. def mount(path, name) @@ -188,6 +192,11 @@ class Server private def authcheck(file, mount, client, clientip) + # If we're local, don't bother passing in information. + if local? + client = nil + clientip = nil + end unless mount.allowed?(client, clientip) mount.warning "%s cannot access %s" % [client, file] @@ -482,12 +491,6 @@ class Server @path = nil end - @comp = Puppet.type(:component).create( - :name => "mount[#{name}]" - ) - #@comp.type = "mount" - #@comp.name = name - super() end @@ -504,8 +507,6 @@ class Server :name => path, :check => CHECKPARAMS ) - - @comp.push(obj) end if links == :manage -- cgit