From dd7d032457f93bf600a1322a34873b1142303da2 Mon Sep 17 00:00:00 2001 From: Chris Nauroth Date: Wed, 16 Apr 2014 23:09:08 +0000 Subject: [PATCH] HADOOP-10499. Remove unused parameter from ProxyUsers.authorize(). Contributed by Chris Nauroth. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1588098 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/ipc/Server.java | 2 +- .../org/apache/hadoop/security/authorize/ProxyUsers.java | 3 +-- .../apache/hadoop/security/authorize/TestProxyUsers.java | 4 ++-- .../org/apache/hadoop/hdfs/server/common/JspHelper.java | 2 +- .../apache/hadoop/security/TestRefreshUserMappings.java | 8 ++++---- .../hadoop/mapreduce/v2/hs/server/TestHSAdminServer.java | 6 +++--- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index c2740c9e20..ff698918e5 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -390,6 +390,9 @@ Release 2.5.0 - UNRELEASED HADOOP-10500. TestDoAsEffectiveUser fails on JDK7 due to failure to reset proxy user configuration. (cnauroth) + HADOOP-10499. Remove unused parameter from ProxyUsers.authorize(). + (Benoy Antony via cnauroth) + Release 2.4.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java index e50e351d00..f1afe192c8 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java @@ -1983,7 +1983,7 @@ private void authorizeConnection() throws WrappedRpcServerException { // authentication if (user != null && user.getRealUser() != null && (authMethod != AuthMethod.TOKEN)) { - ProxyUsers.authorize(user, this.getHostAddress(), conf); + ProxyUsers.authorize(user, this.getHostAddress()); } authorize(user, protocolName, getHostInetAddress()); if (LOG.isDebugEnabled()) { diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/authorize/ProxyUsers.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/authorize/ProxyUsers.java index 7e38c2bc45..e919d4e81f 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/authorize/ProxyUsers.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/authorize/ProxyUsers.java @@ -134,11 +134,10 @@ public static String getProxySuperuserIpConfKey(String userName) { * * @param user ugi of the effective or proxy user which contains a real user * @param remoteAddress the ip address of client - * @param newConf configuration * @throws AuthorizationException */ public static synchronized void authorize(UserGroupInformation user, - String remoteAddress, Configuration newConf) throws AuthorizationException { + String remoteAddress) throws AuthorizationException { if(!init) { refreshSuperUserGroupsConfiguration(); diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/authorize/TestProxyUsers.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/authorize/TestProxyUsers.java index cc00dde5f2..be2364af05 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/authorize/TestProxyUsers.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/authorize/TestProxyUsers.java @@ -271,7 +271,7 @@ public void testProxyServer() { private void assertNotAuthorized(UserGroupInformation proxyUgi, String host) { try { - ProxyUsers.authorize(proxyUgi, host, null); + ProxyUsers.authorize(proxyUgi, host); fail("Allowed authorization of " + proxyUgi + " from " + host); } catch (AuthorizationException e) { // Expected @@ -280,7 +280,7 @@ private void assertNotAuthorized(UserGroupInformation proxyUgi, String host) { private void assertAuthorized(UserGroupInformation proxyUgi, String host) { try { - ProxyUsers.authorize(proxyUgi, host, null); + ProxyUsers.authorize(proxyUgi, host); } catch (AuthorizationException e) { fail("Did not allowed authorization of " + proxyUgi + " from " + host); } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/JspHelper.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/JspHelper.java index 0e474b1bb8..3fd8d8ae04 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/JspHelper.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/JspHelper.java @@ -647,7 +647,7 @@ public static UserGroupInformation getUGI(ServletContext context, if (doAsUserFromQuery != null) { // create and attempt to authorize a proxy user ugi = UserGroupInformation.createProxyUser(doAsUserFromQuery, ugi); - ProxyUsers.authorize(ugi, getRemoteAddr(request), conf); + ProxyUsers.authorize(ugi, getRemoteAddr(request)); } } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/security/TestRefreshUserMappings.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/security/TestRefreshUserMappings.java index 69ea582bfa..df9462828b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/security/TestRefreshUserMappings.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/security/TestRefreshUserMappings.java @@ -179,14 +179,14 @@ public void testRefreshSuperUserGroupsConfiguration() throws Exception { // check before try { - ProxyUsers.authorize(ugi1, "127.0.0.1", config); + ProxyUsers.authorize(ugi1, "127.0.0.1"); fail("first auth for " + ugi1.getShortUserName() + " should've failed "); } catch (AuthorizationException e) { // expected System.err.println("auth for " + ugi1.getUserName() + " failed"); } try { - ProxyUsers.authorize(ugi2, "127.0.0.1", config); + ProxyUsers.authorize(ugi2, "127.0.0.1"); System.err.println("auth for " + ugi2.getUserName() + " succeeded"); // expected } catch (AuthorizationException e) { @@ -204,14 +204,14 @@ public void testRefreshSuperUserGroupsConfiguration() throws Exception { admin.run(args); try { - ProxyUsers.authorize(ugi2, "127.0.0.1", config); + ProxyUsers.authorize(ugi2, "127.0.0.1"); fail("second auth for " + ugi2.getShortUserName() + " should've failed "); } catch (AuthorizationException e) { // expected System.err.println("auth for " + ugi2.getUserName() + " failed"); } try { - ProxyUsers.authorize(ugi1, "127.0.0.1", config); + ProxyUsers.authorize(ugi1, "127.0.0.1"); System.err.println("auth for " + ugi1.getUserName() + " succeeded"); // expected } catch (AuthorizationException e) { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/server/TestHSAdminServer.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/server/TestHSAdminServer.java index f31ebe3b12..277a1953c8 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/server/TestHSAdminServer.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/server/TestHSAdminServer.java @@ -173,7 +173,7 @@ public void testRefreshSuperUserGroups() throws Exception { Throwable th = null; try { - ProxyUsers.authorize(ugi, "127.0.0.1", conf); + ProxyUsers.authorize(ugi, "127.0.0.1"); } catch (Exception e) { th = e; } @@ -189,7 +189,7 @@ public void testRefreshSuperUserGroups() throws Exception { // resetting th th = null; try { - ProxyUsers.authorize(ugi, "127.0.0.1", conf); + ProxyUsers.authorize(ugi, "127.0.0.1"); } catch (Exception e) { th = e; } @@ -202,7 +202,7 @@ public void testRefreshSuperUserGroups() throws Exception { th = null; try { - ProxyUsers.authorize(ugi, "127.0.0.1", conf); + ProxyUsers.authorize(ugi, "127.0.0.1"); } catch (Exception e) { th = e; }