Browse Source

commit 9bd80b12bccc5244ebdb76659f9add3bf7eea858
Author: Devaraj Das <ddas@yahoo-inc.com>
Date: Fri Nov 19 19:00:44 2010 -0800

. Fix on top of the earlier patch.


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/yahoo-merge@1079138 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 14 years ago
parent
commit
8c9fbb289c
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/java/org/apache/hadoop/security/UserGroupInformation.java

+ 5 - 1
src/java/org/apache/hadoop/security/UserGroupInformation.java

@@ -635,6 +635,11 @@ public class UserGroupInformation {
          !isKeytab)
       return;
     
+    long now = System.currentTimeMillis();
+    if (!hasSufficientTimeElapsed(now)) {
+      return;
+    }
+
     KerberosTicket tgt = getTGT();
     //Return if TGT is valid and is not going to expire soon.
     if (tgt != null && System.currentTimeMillis() < getRefreshTime(tgt)) {
@@ -645,7 +650,6 @@ public class UserGroupInformation {
     if (login == null || keytabFile == null) {
       throw new IOException("loginUserFromKeyTab must be done first");
     }
-    long now = System.currentTimeMillis();
     
     long start = 0;
     // register most recent relogin attempt