hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077349 - in /hadoop/common/branches/branch-0.20-security-patches/src: core/org/apache/hadoop/security/Credentials.java hdfs/org/apache/hadoop/hdfs/HftpFileSystem.java
Date Fri, 04 Mar 2011 04:06:02 GMT
Author: omalley
Date: Fri Mar  4 04:06:02 2011
New Revision: 1077349

URL: http://svn.apache.org/viewvc?rev=1077349&view=rev
Log:
commit ace335211d3ae8c52991b944c039d79f6cdaeb0e
Author: Owen O'Malley <omalley@apache.org>
Date:   Fri Mar 19 17:12:53 2010 -0700

    HADOOP-6648. Credentials must ignore null tokens that can be generated
    when using HFTP to talk to insecure clusters. (omalley)
    
    +++ b/YAHOO-CHANGES.txt
    +    HADOOP-6648. Credentials must ignore null tokens that can be generated
    +    when using HFTP to talk to insecure clusters. (omalley)
    +

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/security/Credentials.java
    hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/HftpFileSystem.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/security/Credentials.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/security/Credentials.java?rev=1077349&r1=1077348&r2=1077349&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/security/Credentials.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/security/Credentials.java
Fri Mar  4 04:06:02 2011
@@ -28,6 +28,8 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FSDataInputStream;
 import org.apache.hadoop.fs.FSDataOutputStream;
@@ -43,6 +45,7 @@ import org.apache.hadoop.security.token.
  * secret keys and Tokens.
  */
 public class Credentials implements Writable {
+  private static final Log LOG = LogFactory.getLog(Credentials.class);
 
   private  Map<Text, byte[]> secretKeysMap = new HashMap<Text, byte[]>();
   private  Map<Text, Token<? extends TokenIdentifier>> tokenMap = 
@@ -72,7 +75,11 @@ public class Credentials implements Writ
    * @param t the token object
    */
   public void addToken(Text alias, Token<? extends TokenIdentifier> t) {
-    tokenMap.put(alias, t);
+    if (t != null) {
+      tokenMap.put(alias, t);
+    } else {
+      LOG.warn("Null token ignored for " + alias);
+    }
   }
   
   /**

Modified: hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/HftpFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/HftpFileSystem.java?rev=1077349&r1=1077348&r2=1077349&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/HftpFileSystem.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/HftpFileSystem.java
Fri Mar  4 04:06:02 2011
@@ -140,6 +140,7 @@ public class HftpFileSystem extends File
             } catch (Exception e) {
               LOG.info("Couldn't get a delegation token from " + nnHttpUrl + 
               " using https.");
+              LOG.debug("error was ", e);
               //Maybe the server is in unsecure mode (that's bad but okay)
               return null;
             }



Mime
View raw message