You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by om...@apache.org on 2011/03/04 04:53:41 UTC

svn commit: r1077226 - /hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenIdentifier.java

Author: omalley
Date: Fri Mar  4 03:53:40 2011
New Revision: 1077226

URL: http://svn.apache.org/viewvc?rev=1077226&view=rev
Log:
commit 1ea045d757a79aee9514039d0a8dfcb5c3089ae9
Author: Owen O'Malley <om...@apache.org>
Date:   Thu Feb 25 10:37:41 2010 -0800

    HADOOP-6596. Add a version field to the seialization of the
    AbstractDelegationTokenIdentifier. (omalley)
    
    +++ b/YAHOO-CHANGES.txt
    +    HADOOP-6596. Add a version field to the seialization of the
    +    AbstractDelegationTokenIdentifier. (omalley)
    +

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenIdentifier.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenIdentifier.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenIdentifier.java?rev=1077226&r1=1077225&r2=1077226&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenIdentifier.java (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenIdentifier.java Fri Mar  4 03:53:40 2011
@@ -34,6 +34,7 @@ import org.apache.hadoop.security.token.
 //@InterfaceAudience.LimitedPrivate({HDFS, MAPREDUCE})
 public abstract class AbstractDelegationTokenIdentifier 
 extends TokenIdentifier {
+  private static final byte VERSION = 0;
 
   private Text owner;
   private Text renewer;
@@ -145,6 +146,11 @@ extends TokenIdentifier {
   }
   
   public void readFields(DataInput in) throws IOException {
+    byte version = in.readByte();
+    if (version != VERSION) {
+	throw new IOException("Unknown version of delegation token " + 
+                              version);
+    }
     owner.readFields(in);
     renewer.readFields(in);
     realUser.readFields(in);
@@ -155,6 +161,7 @@ extends TokenIdentifier {
   }
 
   public void write(DataOutput out) throws IOException {
+    out.writeByte(VERSION);
     owner.write(out);
     renewer.write(out);
     realUser.write(out);