jcifs-1.2.25 from tgz
authorFelix Schumacher <p0354740@isib001.(none)>
Thu, 6 Nov 2008 12:14:14 +0000 (13:14 +0100)
committerFelix Schumacher <p0354740@isib001.(none)>
Thu, 6 Nov 2008 12:14:14 +0000 (13:14 +0100)
Sun Oct 19 23:25:45 EDT 2008
jcifs-1.2.25

The DcerpcHandle code to increase the stub size if alloc_hint was
reater
than stub.length was not being engaged properly which would result in
an ArrayIndexOutOfBoundsException if the DCERPC response was larger
han
0xffff. This has been fixed.

Disabled decoding of NativeFileSystem field b/c it seems the iSeries
implementation sends this field in ASCII even though Unicode is
indicated. Fortunately the field is of no interest to anyone so we can
simply omit decoding it.

Added check in copyTo to prevent a possible thread lockup when server
is disconnected during a copy.

Force SMB_COM_TREE_CONNECT_ANDX service to always be what was passed to
the constructor (default is '?????'). IBM iSeries apparently does not
like explicitly specifying 'A:' which can occur on reconnect after
an soTimeout.

README.txt
build.xml
src/jcifs/dcerpc/DcerpcHandle.java
src/jcifs/netbios/NameServiceClient.java
src/jcifs/netbios/NameServicePacket.java
src/jcifs/smb/SmbComTreeConnectAndXResponse.java
src/jcifs/smb/SmbFile.java
src/jcifs/smb/SmbTree.java

index f54421d..217f899 100644 (file)
@@ -1,3 +1,24 @@
+Sun Oct 19 23:25:45 EDT 2008
+jcifs-1.2.25
+
+The DcerpcHandle code to increase the stub size if alloc_hint was greater
+than stub.length was not being engaged properly which would result in
+an ArrayIndexOutOfBoundsException if the DCERPC response was larger than
+0xffff. This has been fixed.
+
+Disabled decoding of NativeFileSystem field b/c it seems the iSeries
+implementation sends this field in ASCII even though Unicode is
+indicated. Fortunately the field is of no interest to anyone so we can
+simply omit decoding it.
+
+Added check in copyTo to prevent a possible thread lockup when server
+is disconnected during a copy.
+
+Force SMB_COM_TREE_CONNECT_ANDX service to always be what was passed to
+the constructor (default is '?????'). IBM iSeries apparently does not
+like explicitly specifying 'A:' which can occur on reconnect after
+an soTimeout.
+
 Wed Jul 23 13:35:20 EDT 2008
 jcifs-1.2.24
 
index 05c1c52..3cbd385 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1,7 +1,7 @@
 <project name="jcifs" default="usage" basedir=".">
 
-    <property name="version" value="1.2.24"/>
-    <property name="reldate" value="Jul 23, 2008"/>
+    <property name="version" value="1.2.25"/>
+    <property name="reldate" value="Oct 20, 2008"/>
 
     <target name="usage">
         <echo>
index 7786a82..e8ac0c5 100644 (file)
@@ -203,7 +203,7 @@ public abstract class DcerpcHandle implements DcerpcConstants {
                 off += stub_frag_len;
             }
 
-            buf.reset();
+            buf = new NdrBuffer(stub, 0);
             msg.decode(buf);
         } finally {
             jcifs.smb.BufferCache.releaseBuffer(stub);
index c250986..80f6ab9 100644 (file)
@@ -258,16 +258,17 @@ class NameServiceClient implements Runnable {
                     responseTable.remove( nid );
                 }
 
-                if (NbtAddress.isWINS( request.addr ) == false)
-                    break;
-
-                                /* Message was sent to WINS but
-                                 * failed to receive response.
-                                 * Try a different WINS server.
-                                 */
-                if (request.addr == NbtAddress.getWINSAddress())
-                    NbtAddress.switchWINS();
-                request.addr = NbtAddress.getWINSAddress();
+                synchronized (LOCK) {
+                    if (NbtAddress.isWINS( request.addr ) == false)
+                        break;
+                                    /* Message was sent to WINS but
+                                     * failed to receive response.
+                                     * Try a different WINS server.
+                                     */
+                    if (request.addr == NbtAddress.getWINSAddress())
+                        NbtAddress.switchWINS();
+                    request.addr = NbtAddress.getWINSAddress();
+                }
             }
         }
     }
index 38b7d47..3107efa 100644 (file)
@@ -251,6 +251,7 @@ abstract class NameServicePacket {
                 break;
             default:
                 opCodeString = Integer.toString( opCode );
+                break;
         }
         switch( resultCode ) {
             case FMT_ERR:
@@ -273,14 +274,18 @@ abstract class NameServicePacket {
                 break;
             default:
                 resultCodeString = "0x" + Hexdump.toHexString( resultCode, 1 );
+                break;
         }
         switch( questionType ) {
             case NB:
                 questionTypeString = "NB";
+                break;
             case NBSTAT:
                 questionTypeString = "NBSTAT";
+                break;
             default:
                 questionTypeString = "0x" + Hexdump.toHexString( questionType, 4 );
+                break;
         }
         switch( recordType ) {
             case A:
@@ -294,10 +299,13 @@ abstract class NameServicePacket {
                 break;
             case NB:
                 recordTypeString = "NB";
+                break;
             case NBSTAT:
                 recordTypeString = "NBSTAT";
+                break;
             default:
                 recordTypeString = "0x" + Hexdump.toHexString( recordType, 4 );
+                break;
         }
 
         return new String(
index 8116089..0ca6f7d 100644 (file)
@@ -54,10 +54,13 @@ class SmbComTreeConnectAndXResponse extends AndXServerMessageBlock {
         }
         bufferIndex += len + 1;
         // win98 observed not returning nativeFileSystem
+/* Problems here with iSeries returning ASCII even though useUnicode = true
+ * Fortunately we don't really need nativeFileSystem for anything.
         if( byteCount > bufferIndex - start ) {
             nativeFileSystem = readString( buffer, bufferIndex );
             bufferIndex += stringWireLength( nativeFileSystem, bufferIndex );
         }
+*/
 
         return bufferIndex - start;
     }
index 2244e24..11df2b7 100644 (file)
@@ -2162,6 +2162,9 @@ if (this instanceof SmbNamedPipe) {
                     send( req, resp );
     
                     synchronized( w ) {
+                        if( w.e != null ) {
+                            throw w.e;
+                        }
                         while( !w.ready ) {
                             try {
                                 w.wait();
index 951bdcf..7ecabb5 100644 (file)
@@ -32,6 +32,7 @@ class SmbTree {
 
     String share;
     String service = "?????";
+    String service0;
     SmbSession session;
     boolean treeConnected, inDfs, inDomainDfs;
     int tree_num;
@@ -42,6 +43,7 @@ class SmbTree {
         if( service != null && service.startsWith( "??" ) == false ) {
             this.service = service;
         }
+        this.service0 = this.service;
     }
 
     boolean matches( String share, String service ) {
@@ -140,6 +142,11 @@ synchronized(transport) {
 
         unc = "\\\\" + session.transport.tconHostName + '\\' + share;
 
+        /* IBM iSeries doesn't like specifying a service. Always reset
+         * the service to whatever was determined in the constructor.
+         */
+        service = service0;
+
         /*
          * Tree Connect And X Request / Response
          */