diff options
author | Brice Figureau <brice-puppet@daysofwonder.com> | 2009-07-20 23:09:09 +0200 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-07-21 08:05:17 +1000 |
commit | 17205bb4e5d246f7a47b995826927a38b83fb3d0 (patch) | |
tree | 3774ff280ea0083c5be11fdcd8ba0294ed6733c1 | |
parent | f2c55cc6b4dd6a4db307ea1c031120398fe5fc7e (diff) | |
download | puppet-17205bb4e5d246f7a47b995826927a38b83fb3d0.tar.gz puppet-17205bb4e5d246f7a47b995826927a38b83fb3d0.tar.xz puppet-17205bb4e5d246f7a47b995826927a38b83fb3d0.zip |
Fix #2424 - take 2, make sure default mounts allow every clients
If there isn't any default mounts for plugins/modules, puppet
auto creates them. The issue is that they don't have any
authorization attached, so they default to deny all.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
-rw-r--r-- | lib/puppet/file_serving/configuration.rb | 2 | ||||
-rwxr-xr-x | spec/unit/file_serving/configuration.rb | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/puppet/file_serving/configuration.rb b/lib/puppet/file_serving/configuration.rb index 6f36d2750..3140455c7 100644 --- a/lib/puppet/file_serving/configuration.rb +++ b/lib/puppet/file_serving/configuration.rb @@ -96,7 +96,9 @@ class Puppet::FileServing::Configuration def mk_default_mounts @mounts["modules"] ||= Mount::Modules.new("modules") + @mounts["modules"].allow('*') @mounts["plugins"] ||= Mount::Plugins.new("plugins") + @mounts["plugins"].allow('*') end # Read the configuration file. diff --git a/spec/unit/file_serving/configuration.rb b/spec/unit/file_serving/configuration.rb index 9545f01cc..57ae83a14 100755 --- a/spec/unit/file_serving/configuration.rb +++ b/spec/unit/file_serving/configuration.rb @@ -102,6 +102,19 @@ describe Puppet::FileServing::Configuration do config.mounted?("plugins").should be_true end + it "should allow all access to modules and plugins if no fileserver.conf exists" do + FileTest.expects(:exists?).returns false # the file doesn't exist + modules = stub 'modules' + Puppet::FileServing::Mount::Modules.stubs(:new).returns(modules) + modules.expects(:allow).with('*') + + plugins = stub 'plugins' + Puppet::FileServing::Mount::Plugins.stubs(:new).returns(plugins) + plugins.expects(:allow).with('*') + + Puppet::FileServing::Configuration.create + end + it "should add modules and plugins mounts even if they are not returned by the parser" do @parser.expects(:parse).returns("one" => mock("mount")) FileTest.expects(:exists?).returns true # the file doesn't exist |