directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r1037351 - /directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlags.java
Date Sat, 20 Nov 2010 23:02:40 GMT
Author: felixk
Date: Sat Nov 20 23:02:40 2010
New Revision: 1037351

URL: http://svn.apache.org/viewvc?rev=1037351&view=rev
Log:
Respect the first flag containing the number of unused bytes

Modified:
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlags.java

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlags.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlags.java?rev=1037351&r1=1037350&r2=1037351&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlags.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlags.java
Sat Nov 20 23:02:40 2010
@@ -158,16 +158,16 @@ public abstract class AbstractKerberosFl
     
     /**
      * Modify a byte array to an integer value
-     * @param bytes The 4 bytes byte array to transform.
+     * @param bytes The 1 + 4 bytes byte array to transform.
      */
     public void setFlags( byte[] bytes )
     {
-        if ( (bytes== null ) || ( bytes.length != 4 ) )
+        if ( (bytes== null ) || ( bytes.length != 5 ) )
         {
             value = -1;
         }
         
-        value = ( ( bytes[0] & 0x00F ) << 24 ) | ( ( bytes[1] & 0x00FF ) <<
16 ) | ( ( bytes[2] & 0x00FF ) << 8 ) | ( 0x00FF & bytes[3] ); 
+        value = ( ( bytes[1] & 0x00F ) << 24 ) | ( ( bytes[2] & 0x00FF ) <<
16 ) | ( ( bytes[3] & 0x00FF ) << 8 ) | ( 0x00FF & bytes[4] ); 
         setData( bytes );
     }
     



Mime
View raw message