diff options
author | Brice Figureau <brice-puppet@daysofwonder.com> | 2010-07-25 19:19:04 +0200 |
---|---|---|
committer | Markus Roberts <Markus@reality.com> | 2010-07-25 22:24:51 -0700 |
commit | ef9a4a6df163c370a524d9ab76453c96bb99e8a4 (patch) | |
tree | 9118c2580869e3290269a11dabff95f0fa86d28a /lib | |
parent | 4065e81f76020c29ed8ccfc1cf6c481aa202cb23 (diff) | |
download | puppet-ef9a4a6df163c370a524d9ab76453c96bb99e8a4.tar.gz puppet-ef9a4a6df163c370a524d9ab76453c96bb99e8a4.tar.xz puppet-ef9a4a6df163c370a524d9ab76453c96bb99e8a4.zip |
Fix #4245 - default insertion of ACL is not thread safe
This can happen under jruby with native threads.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/network/rest_authconfig.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/puppet/network/rest_authconfig.rb b/lib/puppet/network/rest_authconfig.rb index 38a8f9a09..82d5a9de2 100644 --- a/lib/puppet/network/rest_authconfig.rb +++ b/lib/puppet/network/rest_authconfig.rb @@ -3,6 +3,7 @@ require 'puppet/network/authconfig' module Puppet class Network::RestAuthConfig < Network::AuthConfig + extend MonitorMixin attr_accessor :rights DEFAULT_ACL = [ @@ -20,9 +21,11 @@ module Puppet ] def self.main - add_acl = @main.nil? - super - @main.insert_default_acl if add_acl and !@main.exists? + synchronize do + add_acl = @main.nil? + super + @main.insert_default_acl if add_acl and !@main.exists? + end @main end |