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
This commit is contained in:
Chris Nauroth 2014-04-16 23:09:08 +00:00
parent 9a0dec60ff
commit dd7d032457
7 changed files with 15 additions and 13 deletions

View File

@ -390,6 +390,9 @@ Release 2.5.0 - UNRELEASED
HADOOP-10500. TestDoAsEffectiveUser fails on JDK7 due to failure to reset HADOOP-10500. TestDoAsEffectiveUser fails on JDK7 due to failure to reset
proxy user configuration. (cnauroth) proxy user configuration. (cnauroth)
HADOOP-10499. Remove unused parameter from ProxyUsers.authorize().
(Benoy Antony via cnauroth)
Release 2.4.1 - UNRELEASED Release 2.4.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -1983,7 +1983,7 @@ private void authorizeConnection() throws WrappedRpcServerException {
// authentication // authentication
if (user != null && user.getRealUser() != null if (user != null && user.getRealUser() != null
&& (authMethod != AuthMethod.TOKEN)) { && (authMethod != AuthMethod.TOKEN)) {
ProxyUsers.authorize(user, this.getHostAddress(), conf); ProxyUsers.authorize(user, this.getHostAddress());
} }
authorize(user, protocolName, getHostInetAddress()); authorize(user, protocolName, getHostInetAddress());
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {

View File

@ -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 user ugi of the effective or proxy user which contains a real user
* @param remoteAddress the ip address of client * @param remoteAddress the ip address of client
* @param newConf configuration
* @throws AuthorizationException * @throws AuthorizationException
*/ */
public static synchronized void authorize(UserGroupInformation user, public static synchronized void authorize(UserGroupInformation user,
String remoteAddress, Configuration newConf) throws AuthorizationException { String remoteAddress) throws AuthorizationException {
if(!init) { if(!init) {
refreshSuperUserGroupsConfiguration(); refreshSuperUserGroupsConfiguration();

View File

@ -271,7 +271,7 @@ public void testProxyServer() {
private void assertNotAuthorized(UserGroupInformation proxyUgi, String host) { private void assertNotAuthorized(UserGroupInformation proxyUgi, String host) {
try { try {
ProxyUsers.authorize(proxyUgi, host, null); ProxyUsers.authorize(proxyUgi, host);
fail("Allowed authorization of " + proxyUgi + " from " + host); fail("Allowed authorization of " + proxyUgi + " from " + host);
} catch (AuthorizationException e) { } catch (AuthorizationException e) {
// Expected // Expected
@ -280,7 +280,7 @@ private void assertNotAuthorized(UserGroupInformation proxyUgi, String host) {
private void assertAuthorized(UserGroupInformation proxyUgi, String host) { private void assertAuthorized(UserGroupInformation proxyUgi, String host) {
try { try {
ProxyUsers.authorize(proxyUgi, host, null); ProxyUsers.authorize(proxyUgi, host);
} catch (AuthorizationException e) { } catch (AuthorizationException e) {
fail("Did not allowed authorization of " + proxyUgi + " from " + host); fail("Did not allowed authorization of " + proxyUgi + " from " + host);
} }

View File

@ -647,7 +647,7 @@ public static UserGroupInformation getUGI(ServletContext context,
if (doAsUserFromQuery != null) { if (doAsUserFromQuery != null) {
// create and attempt to authorize a proxy user // create and attempt to authorize a proxy user
ugi = UserGroupInformation.createProxyUser(doAsUserFromQuery, ugi); ugi = UserGroupInformation.createProxyUser(doAsUserFromQuery, ugi);
ProxyUsers.authorize(ugi, getRemoteAddr(request), conf); ProxyUsers.authorize(ugi, getRemoteAddr(request));
} }
} }

View File

@ -179,14 +179,14 @@ public void testRefreshSuperUserGroupsConfiguration() throws Exception {
// check before // check before
try { 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 "); fail("first auth for " + ugi1.getShortUserName() + " should've failed ");
} catch (AuthorizationException e) { } catch (AuthorizationException e) {
// expected // expected
System.err.println("auth for " + ugi1.getUserName() + " failed"); System.err.println("auth for " + ugi1.getUserName() + " failed");
} }
try { try {
ProxyUsers.authorize(ugi2, "127.0.0.1", config); ProxyUsers.authorize(ugi2, "127.0.0.1");
System.err.println("auth for " + ugi2.getUserName() + " succeeded"); System.err.println("auth for " + ugi2.getUserName() + " succeeded");
// expected // expected
} catch (AuthorizationException e) { } catch (AuthorizationException e) {
@ -204,14 +204,14 @@ public void testRefreshSuperUserGroupsConfiguration() throws Exception {
admin.run(args); admin.run(args);
try { 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 "); fail("second auth for " + ugi2.getShortUserName() + " should've failed ");
} catch (AuthorizationException e) { } catch (AuthorizationException e) {
// expected // expected
System.err.println("auth for " + ugi2.getUserName() + " failed"); System.err.println("auth for " + ugi2.getUserName() + " failed");
} }
try { try {
ProxyUsers.authorize(ugi1, "127.0.0.1", config); ProxyUsers.authorize(ugi1, "127.0.0.1");
System.err.println("auth for " + ugi1.getUserName() + " succeeded"); System.err.println("auth for " + ugi1.getUserName() + " succeeded");
// expected // expected
} catch (AuthorizationException e) { } catch (AuthorizationException e) {

View File

@ -173,7 +173,7 @@ public void testRefreshSuperUserGroups() throws Exception {
Throwable th = null; Throwable th = null;
try { try {
ProxyUsers.authorize(ugi, "127.0.0.1", conf); ProxyUsers.authorize(ugi, "127.0.0.1");
} catch (Exception e) { } catch (Exception e) {
th = e; th = e;
} }
@ -189,7 +189,7 @@ public void testRefreshSuperUserGroups() throws Exception {
// resetting th // resetting th
th = null; th = null;
try { try {
ProxyUsers.authorize(ugi, "127.0.0.1", conf); ProxyUsers.authorize(ugi, "127.0.0.1");
} catch (Exception e) { } catch (Exception e) {
th = e; th = e;
} }
@ -202,7 +202,7 @@ public void testRefreshSuperUserGroups() throws Exception {
th = null; th = null;
try { try {
ProxyUsers.authorize(ugi, "127.0.0.1", conf); ProxyUsers.authorize(ugi, "127.0.0.1");
} catch (Exception e) { } catch (Exception e) {
th = e; th = e;
} }