I didn't test this patch at all. Nigel can you check it works for you? Thanks, Brice
Original Commit Msg: 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 <[email protected]> --- lib/puppet/file_serving/configuration.rb | 2 ++ 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 6f36d27..3140455 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 9545f01..57ae83a 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 -- 1.6.0.2 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---
