tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session SerializablePrincipal.java
Date Thu, 09 Dec 2004 14:40:59 GMT
fhanik      2004/12/09 06:40:59

  Modified:    modules/cluster/src/share/org/apache/catalina/cluster/session
                        Tag: TOMCAT_5_0 SerializablePrincipal.java
  Log:
  Same fix as for tomcat 5.5, avoid nullpointer exception with null passwords
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.3.2.1   +6 -3      jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/SerializablePrincipal.java
  
  Index: SerializablePrincipal.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/SerializablePrincipal.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- SerializablePrincipal.java	27 Feb 2004 14:58:56 -0000	1.3
  +++ SerializablePrincipal.java	9 Dec 2004 14:40:59 -0000	1.3.2.1
  @@ -168,7 +168,9 @@
       
       public static GenericPrincipal readPrincipal(java.io.ObjectInputStream in, Realm realm)
throws java.io.IOException{
           String name = in.readUTF();
  -        String pwd = in.readUTF();
  +        boolean hasPwd = in.readBoolean();
  +        String pwd = null;
  +        if ( hasPwd ) pwd = in.readUTF();
           int size = in.readInt();
           String[] roles = new String[size];
           for ( int i=0; i<size; i++ ) roles[i] = in.readUTF();
  @@ -177,7 +179,8 @@
       
       public static void writePrincipal(GenericPrincipal p, java.io.ObjectOutputStream out)
throws java.io.IOException {
           out.writeUTF(p.getName());
  -        out.writeUTF(p.getPassword());
  +        out.writeBoolean(p.getPassword()!=null);
  +        if ( p.getPassword()!= null ) out.writeUTF(p.getPassword());
           String[] roles = p.getRoles();
           if ( roles == null ) roles = new String[0];
           out.writeInt(roles.length);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message