hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1362768 - in /hadoop/common/branches/branch-1: ./ src/hdfs/org/apache/hadoop/hdfs/server/namenode/ src/test/org/apache/hadoop/hdfs/server/namenode/
Date Wed, 18 Jul 2012 05:19:47 GMT
Author: eli
Date: Wed Jul 18 05:19:46 2012
New Revision: 1362768

URL: http://svn.apache.org/viewvc?rev=1362768&view=rev
Log:
Revert HDFS-3654. TestJspHelper#testGetUgi fails with NPE.

Modified:
    hadoop/common/branches/branch-1/CHANGES.txt
    hadoop/common/branches/branch-1/src/hdfs/org/apache/hadoop/hdfs/server/namenode/JspHelper.java
    hadoop/common/branches/branch-1/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java
    hadoop/common/branches/branch-1/src/test/org/apache/hadoop/hdfs/server/namenode/TestJspHelper.java

Modified: hadoop/common/branches/branch-1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/CHANGES.txt?rev=1362768&r1=1362767&r2=1362768&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1/CHANGES.txt Wed Jul 18 05:19:46 2012
@@ -89,8 +89,6 @@ Release 1.2.0 - unreleased
     HADOOP-7836. TestSaslRPC#testDigestAuthMethodHostBasedToken fails
     with hostname localhost.localdomain. (daryn via eli)
  
-    HDFS-3654. TestJspHelper#testGetUgi fails with NPE. (eli)
-
     HADOOP-8423. MapFile.Reader.get() crashes jvm or throws EOFException on
     Snappy or LZO block-compressed data (todd and harsh)
 

Modified: hadoop/common/branches/branch-1/src/hdfs/org/apache/hadoop/hdfs/server/namenode/JspHelper.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/hdfs/org/apache/hadoop/hdfs/server/namenode/JspHelper.java?rev=1362768&r1=1362767&r2=1362768&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/hdfs/org/apache/hadoop/hdfs/server/namenode/JspHelper.java
(original)
+++ hadoop/common/branches/branch-1/src/hdfs/org/apache/hadoop/hdfs/server/namenode/JspHelper.java
Wed Jul 18 05:19:46 2012
@@ -471,7 +471,7 @@ public class JspHelper {
     final String usernameFromQuery = getUsernameFromQuery(request, tryUgiParameter);
     final String doAsUserFromQuery = request.getParameter(DoAsParam.NAME);
 
-    if (UserGroupInformation.isSecurityEnabled()) {
+    if(UserGroupInformation.isSecurityEnabled()) {
       final String remoteUser = request.getRemoteUser();
       String tokenString = request.getParameter(DELEGATION_PARAMETER_NAME);
       if (tokenString != null) {
@@ -487,7 +487,8 @@ public class JspHelper {
         DelegationTokenIdentifier id = new DelegationTokenIdentifier();
         id.readFields(in);
         NameNode nn = (NameNode) context.getAttribute("name.node");
-        nn.verifyToken(id, token.getPassword());
+        nn.getNamesystem().getDelegationTokenSecretManager()
+          .verifyToken(id, token.getPassword());
         ugi = id.getUser();
         if (ugi.getRealUser() == null) {
           //non-proxy case

Modified: hadoop/common/branches/branch-1/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java?rev=1362768&r1=1362767&r2=1362768&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java
(original)
+++ hadoop/common/branches/branch-1/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java
Wed Jul 18 05:19:46 2012
@@ -1372,13 +1372,7 @@ public class NameNode implements ClientP
     NameNode namenode = new NameNode(conf);
     return namenode;
   }
-
-  public synchronized void verifyToken(DelegationTokenIdentifier identifier, 
-      byte[] password) throws InvalidToken {
-    namesystem.getDelegationTokenSecretManager().verifyToken(
-        identifier, password);
-  }
-
+    
   /**
    */
   public static void main(String argv[]) throws Exception {

Modified: hadoop/common/branches/branch-1/src/test/org/apache/hadoop/hdfs/server/namenode/TestJspHelper.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/test/org/apache/hadoop/hdfs/server/namenode/TestJspHelper.java?rev=1362768&r1=1362767&r2=1362768&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/test/org/apache/hadoop/hdfs/server/namenode/TestJspHelper.java
(original)
+++ hadoop/common/branches/branch-1/src/test/org/apache/hadoop/hdfs/server/namenode/TestJspHelper.java
Wed Jul 18 05:19:46 2012
@@ -24,7 +24,6 @@ import java.io.IOException;
 import java.net.InetSocketAddress;
 
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.ServletContext;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hdfs.DFSConfigKeys;
@@ -68,8 +67,6 @@ public class TestJspHelper {
   public void testGetUgi() throws IOException {
     conf.set(DFSConfigKeys.FS_DEFAULT_NAME_KEY, "hdfs://localhost:4321/");
     HttpServletRequest request = mock(HttpServletRequest.class);
-    ServletContext context = mock(ServletContext.class);
-    NameNode nn = mock(NameNode.class);
     String user = "TheDoctor";
     Text userText = new Text(user);
     DelegationTokenIdentifier dtId = new DelegationTokenIdentifier(userText,
@@ -80,7 +77,6 @@ public class TestJspHelper {
     when(request.getParameter(JspHelper.DELEGATION_PARAMETER_NAME)).thenReturn(
         tokenString);
     when(request.getRemoteUser()).thenReturn(user);
-    when(context.getAttribute("name.node")).thenReturn(nn);
 
     conf.set(DFSConfigKeys.HADOOP_SECURITY_AUTHENTICATION, "kerberos");
     UserGroupInformation.setConfiguration(conf);
@@ -88,7 +84,7 @@ public class TestJspHelper {
     InetSocketAddress serviceAddr = NameNode.getAddress(conf);
     Text tokenService = SecurityUtil.buildTokenService(serviceAddr);
 
-    UserGroupInformation ugi = JspHelper.getUGI(context, request, conf);
+    UserGroupInformation ugi = JspHelper.getUGI(request, conf);
     Token<? extends TokenIdentifier> tokenInUgi = ugi.getTokens().iterator()
         .next();
     Assert.assertEquals(tokenService, tokenInUgi.getService());



Mime
View raw message