jcifs-1.1.4 from tgz
authorFelix Schumacher <p0354740@isib001.(none)>
Wed, 6 Aug 2008 14:25:50 +0000 (16:25 +0200)
committerFelix Schumacher <p0354740@isib001.(none)>
Wed, 6 Aug 2008 14:25:50 +0000 (16:25 +0200)
Tue Dec  7 18:34:35 EST 2004
jcifs-1.1.4 released

Two  bugs  regarding  the  upcasing of domain and username fields with LMv2
authentication   (used   with   lmCompatibility   =  3)  have  been  fixed.
Additionally  the  firstCalledName/nextCalledName  methods changed in 1.1.0
have been changed back to the old behavior. The change was not warranted as
it did not emulate Windows behavior.

README.txt
build.xml
src/jcifs/netbios/NbtAddress.java
src/jcifs/ntlmssp/Type3Message.java
src/jcifs/smb/SmbComSessionSetupAndX.java

index 3ba27d5..ab00b5b 100644 (file)
@@ -1,3 +1,12 @@
+Tue Dec  7 18:34:35 EST 2004
+jcifs-1.1.4 released
+
+Two  bugs  regarding  the  upcasing of domain and username fields with LMv2
+authentication   (used   with   lmCompatibility   =  3)  have  been  fixed.
+Additionally  the  firstCalledName/nextCalledName  methods changed in 1.1.0
+have been changed back to the old behavior. The change was not warranted as
+it did not emulate Windows behavior. 
+
 Tue Nov 30 19:20:57 EST 2004
 jcifs-1.1.3 released
 
index 8448fe9..a2e77da 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1,7 +1,7 @@
 <project name="jcifs" default="usage" basedir=".">
 
-    <property name="version" value="1.1.3"/>
-    <property name="reldate" value="Nov 30, 2004"/>
+    <property name="version" value="1.1.4"/>
+    <property name="reldate" value="Dec 7, 2004"/>
 
     <target name="usage">
         <echo>
index cbff6e3..18bddbe 100644 (file)
@@ -582,14 +582,38 @@ public final class NbtAddress {
  */
 
     public String firstCalledName() {
-        calledName = SMBSERVER_NAME;
+
+        calledName = hostName.name;
+
+        if( Character.isDigit( calledName.charAt( 0 ))) {
+            int i, len, dots;
+            char[] data;
+
+            i = dots = 0;                    /* quick IP address validation */
+            len = calledName.length();
+            data = calledName.toCharArray();
+            while( i < len && Character.isDigit( data[i++] )) {
+                if( i == len && dots == 3 ) {
+                    // probably an IP address
+                    calledName = SMBSERVER_NAME;
+                    break;
+                }
+                if( i < len && data[i] == '.' ) {
+                    dots++;
+                    i++;
+                }
+            }
+        } else if( hostName.hexCode == 0x1D ) {
+            calledName = SMBSERVER_NAME;
+        }
+
         return calledName;
     }
     public String nextCalledName() {
 
-        if( calledName == SMBSERVER_NAME ) {
-            calledName = hostName.name;
-        } else if( calledName == hostName.name ) {
+        if( calledName == hostName.name ) {
+            calledName = SMBSERVER_NAME;
+        } else if( calledName == SMBSERVER_NAME ) {
             NbtAddress[] addrs;
 
             try {
index bcac159..3523728 100644 (file)
@@ -325,7 +325,7 @@ public class Type3Message extends NtlmMessage {
             byte[] domain = null;
             if (domainName != null && domainName.length() != 0) {
                 domain = unicode ?
-                        domainName.getBytes("UnicodeLittleUnmarked") :
+                        domainName.toUpperCase().getBytes("UnicodeLittleUnmarked") :
                                 domainName.toUpperCase().getBytes(oem);
             }
             int domainLength = (domain != null) ? domain.length : 0;
index efe4123..655c750 100644 (file)
@@ -112,7 +112,7 @@ class SmbComSessionSetupAndX extends AndXServerMessageBlock {
     int writeBytesWireFormat( byte[] dst, int dstIndex ) {
         int start = dstIndex;
 
-        accountName = auth.username.toUpperCase();
+        accountName = useUnicode ? auth.username : auth.username.toUpperCase();
         primaryDomain = auth.domain.toUpperCase();
 
         if( session.transport.server.security == SECURITY_USER &&