From 5c6df64f8d39fcde5962e0d092a4360eb3d36038 Mon Sep 17 00:00:00 2001 From: Vinayakumar B Date: Wed, 18 Jun 2014 05:31:23 +0000 Subject: [PATCH] Merged revision(s) 1603356 from hadoop/common/trunk: HADOOP-10590. ServiceAuthorizationManager is not threadsafe. (Contributed by Benoy Antony) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1603357 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 2 ++ .../security/authorize/ServiceAuthorizationManager.java | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index cbdff5b8f68..62c93f39b75 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -252,6 +252,8 @@ Release 2.5.0 - UNRELEASED HADOOP-10561. Copy command with preserve option should handle Xattrs. (Yi Liu via cnauroth) + HADOOP-10590. ServiceAuthorizationManager is not threadsafe. (Benoy Antony via vinayakumarb) + Release 2.4.1 - 2014-06-23 INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/authorize/ServiceAuthorizationManager.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/authorize/ServiceAuthorizationManager.java index 66ab50cc58e..29d4a6ac47b 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/authorize/ServiceAuthorizationManager.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/authorize/ServiceAuthorizationManager.java @@ -45,7 +45,7 @@ import com.google.common.annotations.VisibleForTesting; public class ServiceAuthorizationManager { private static final String HADOOP_POLICY_FILE = "hadoop-policy.xml"; - private Map, AccessControlList> protocolToAcl = + private volatile Map, AccessControlList> protocolToAcl = new IdentityHashMap, AccessControlList>(); /** @@ -114,7 +114,7 @@ public class ServiceAuthorizationManager { AUDITLOG.info(AUTHZ_SUCCESSFUL_FOR + user + " for protocol="+protocol); } - public synchronized void refresh(Configuration conf, + public void refresh(Configuration conf, PolicyProvider provider) { // Get the system property 'hadoop.policy.file' String policyFile = @@ -127,7 +127,7 @@ public class ServiceAuthorizationManager { } @Private - public synchronized void refreshWithLoadedConfiguration(Configuration conf, + public void refreshWithLoadedConfiguration(Configuration conf, PolicyProvider provider) { final Map, AccessControlList> newAcls = new IdentityHashMap, AccessControlList>();