hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077337 - in /hadoop/common/branches/branch-0.20-security-patches/src: core/org/apache/hadoop/security/token/delegation/ hdfs/org/apache/hadoop/hdfs/server/namenode/ mapred/org/apache/hadoop/mapreduce/security/
Date Fri, 04 Mar 2011 04:04:48 GMT
Author: omalley
Date: Fri Mar  4 04:04:48 2011
New Revision: 1077337

URL: http://svn.apache.org/viewvc?rev=1077337&view=rev
Log:
commit ea9cfe2f071253b979ba9da8ccd883afaa385904
Author: Boris Shkolnik <borya@yahoo-inc.com>
Date:   Thu Mar 18 15:42:18 2010 -0700

    HDFS:1044 from https://issues.apache.org/jira/secure/attachment/12439220/HDFS-1044-BP20-6.patch
    
    +++ b/YAHOO-CHANGES.txt
    +    HDFS-1044.  Cannot submit mapreduce job from secure client to
    +    unsecure sever. (boryas)

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java
    hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapreduce/security/TokenCache.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java?rev=1077337&r1=1077336&r2=1077337&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java
Fri Mar  4 04:04:48 2011
@@ -102,6 +102,14 @@ extends AbstractDelegationTokenIdentifie
     tokenRemoverThread.start();
   }
   
+  /**
+   * is secretMgr running
+   * @return true if secret mgr is running
+   */
+  public synchronized boolean isRunning() {
+    return running;
+  }
+  
   /** 
    * Add a previously used master key to cache (when NN restarts), 
    * should be called before activate().

Modified: hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java?rev=1077337&r1=1077336&r2=1077337&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
Fri Mar  4 04:04:48 2011
@@ -4947,6 +4947,11 @@ public class FSNamesystem implements FSC
       throw new IOException(
           "Delegation Token can be issued only with kerberos or web authentication");
     }
+    if(dtSecretManager == null || !dtSecretManager.isRunning()) {
+      LOG.warn("trying to get DT with no secret manager running");
+      return null;
+    }
+    
     UserGroupInformation ugi = UserGroupInformation.getCurrentUser();
     String user = ugi.getUserName();
     Text owner = new Text(user);

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapreduce/security/TokenCache.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapreduce/security/TokenCache.java?rev=1077337&r1=1077336&r2=1077337&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapreduce/security/TokenCache.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapreduce/security/TokenCache.java
Fri Mar  4 04:04:48 2011
@@ -123,8 +123,10 @@ public class TokenCache {
         }
         // get the token
         token = dfs.getDelegationToken(delegTokenRenewer);
-        if(token==null) 
-          throw new IOException("Token from " + fs_addr + " is null");
+        if(token==null) {
+          LOG.warn("Token from " + fs_addr + " is null");
+          continue;
+        }
 
         token.setService(new Text(fs_addr));
         credentials.addToken(new Text(fs_addr), token);



Mime
View raw message