hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bor...@apache.org
Subject svn commit: r989414 - in /hadoop/hdfs/trunk: ./ src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ src/java/org/apache/hadoop/hdfs/ src/java/org/apache/hadoop/hdfs/server/common/ src/java/org/apache/hadoop/hdfs/server/namenode/
Date Thu, 26 Aug 2010 00:35:32 GMT
Author: boryas
Date: Thu Aug 26 00:35:32 2010
New Revision: 989414

URL: http://svn.apache.org/viewvc?rev=989414&view=rev
Log:
HDFS-1340. A null delegation token is appended to the url if security is disabled when browsing
filesystem.

Modified:
    hadoop/hdfs/trunk/CHANGES.txt
    hadoop/hdfs/trunk/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFileDataServlet.java
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/HftpFileSystem.java
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/common/JspHelper.java
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/DfsServlet.java
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FileDataServlet.java
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=989414&r1=989413&r2=989414&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Thu Aug 26 00:35:32 2010
@@ -218,6 +218,9 @@ Trunk (unreleased changes)
 
     HDFS-1349. Remove empty java files. (Eli Collins)
 
+    HDFS-1340.A null delegation token is appended to the url if security
+     is disabled when browsing filesystem. (boryas)
+
 Release 0.21.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/hdfs/trunk/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFileDataServlet.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFileDataServlet.java?rev=989414&r1=989413&r2=989414&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFileDataServlet.java
(original)
+++ hadoop/hdfs/trunk/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFileDataServlet.java
Thu Aug 26 00:35:32 2010
@@ -42,8 +42,7 @@ public class ProxyFileDataServlet extend
       URISyntaxException {
     String dtParam="";
     if (dt != null) {
-      StringBuilder sb = new StringBuilder(JspHelper.SET_DELEGATION).append(dt);
-      dtParam=sb.toString();
+      dtParam=JspHelper.getDelegationTokenUrlParam(dt);
     }
 
     return new URI(request.getScheme(), null, request.getServerName(), request

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/HftpFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/HftpFileSystem.java?rev=989414&r1=989413&r2=989414&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/HftpFileSystem.java (original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/HftpFileSystem.java Thu Aug 26 00:35:32
2010
@@ -282,7 +282,7 @@ public class HftpFileSystem extends File
       synchronized (this) {
         if (delegationToken != null) {
           tokenString = delegationToken.encodeToUrlString();
-          return (query + JspHelper.SET_DELEGATION + tokenString);
+          return (query + JspHelper.getDelegationTokenUrlParam(tokenString));
         } // else we are talking to an insecure cluster
       }
     }

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/common/JspHelper.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/common/JspHelper.java?rev=989414&r1=989413&r2=989414&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/common/JspHelper.java (original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/common/JspHelper.java Thu Aug
26 00:35:32 2010
@@ -48,11 +48,9 @@ import org.apache.hadoop.hdfs.protocol.L
 import org.apache.hadoop.hdfs.protocol.LocatedBlocks;
 import org.apache.hadoop.hdfs.security.token.block.BlockTokenIdentifier;
 import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier;
-import org.apache.hadoop.hdfs.server.datanode.DatanodeJspHelper;
 import org.apache.hadoop.hdfs.server.namenode.DatanodeDescriptor;
 import org.apache.hadoop.hdfs.server.namenode.NameNode;
 import org.apache.hadoop.http.HtmlQuoting;
-import org.apache.hadoop.io.WritableUtils;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.net.NetUtils;
 import org.apache.hadoop.security.AccessControlException;
@@ -66,7 +64,7 @@ public class JspHelper {
   public static final String CURRENT_CONF = "current.conf";
   final static public String WEB_UGI_PROPERTY_NAME = "dfs.web.ugi";
   public static final String DELEGATION_PARAMETER_NAME = "delegation";
-  public static final String SET_DELEGATION = "&" + DELEGATION_PARAMETER_NAME +
+  static final String SET_DELEGATION = "&" + DELEGATION_PARAMETER_NAME +
                                               "=";
   private static final Log LOG = LogFactory.getLog(JspHelper.class);
 

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/DfsServlet.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/DfsServlet.java?rev=989414&r1=989413&r2=989414&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/DfsServlet.java (original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/DfsServlet.java Thu
Aug 26 00:35:32 2010
@@ -103,8 +103,8 @@ abstract class DfsServlet extends HttpSe
     params.append("filename=");
     params.append(filename);
     if (UserGroupInformation.isSecurityEnabled()) {
-      params.append(JspHelper.SET_DELEGATION);
-      params.append(ugi.getTokens().iterator().next().encodeToUrlString());
+      String tokenString = ugi.getTokens().iterator().next().encodeToUrlString();
+      params.append(JspHelper.getDelegationTokenUrlParam(tokenString));
     } else {
       params.append("&ugi=");
       params.append(ugi.getShortUserName());

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FileDataServlet.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FileDataServlet.java?rev=989414&r1=989413&r2=989414&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FileDataServlet.java
(original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FileDataServlet.java
Thu Aug 26 00:35:32 2010
@@ -59,8 +59,7 @@ public class FileDataServlet extends Dfs
         
     String dtParam="";
     if (dt != null) {
-      StringBuilder sb = new StringBuilder(JspHelper.SET_DELEGATION).append(dt);
-      dtParam=sb.toString();
+      dtParam=JspHelper.getDelegationTokenUrlParam(dt);
     }
 
     return new URI(scheme, null, hostname,

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java?rev=989414&r1=989413&r2=989414&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
(original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
Thu Aug 26 00:35:32 2010
@@ -334,7 +334,7 @@ class NamenodeJspHelper {
         + "/browseDirectory.jsp?namenodeInfoPort="
         + nn.getHttpAddress().getPort() + "&dir=/"
         + (tokenString == null ? "" :
-           JspHelper.SET_DELEGATION + tokenString);
+           JspHelper.getDelegationTokenUrlParam(tokenString));
     resp.sendRedirect(redirectLocation);
   }
 



Mime
View raw message