+Thu Dec 16 21:57:23 EST 2004
+jcifs-1.1.5 released
+
+It was discovered that an ArrayIndexOutOfBoundsException could occur if the
+list of domain controllers returned by NbtAddress.getAllByName was shorter
+than the list returned in the previous call (possibly because the WINS
+query timed out and switched to an alternate WINS server). All NTLM HTTP
+Authentication Filter users should upgrade to prevent this error. Also, the
+value of jcifs.netbios.cachePolicy set by the NTLM HTTP Filter if it is
+not specified has been doubled to 20 minutes. Finally, some log levels have
+been increased such that running with jcifs.util.loglevel = 3 temporarily
+is actually reasonable in a production environment (must use loglevel > 3
+to see individual SMB messages and loglevel > 5 to get hexdumps).
+
Tue Dec 7 18:34:35 EST 2004
jcifs-1.1.4 released
<project name="jcifs" default="usage" basedir=".">
- <property name="version" value="1.1.4"/>
- <property name="reldate" value="Dec 7, 2004"/>
+ <property name="version" value="1.1.5"/>
+ <property name="reldate" value="Dec 17, 2004"/>
<target name="usage">
<echo>
/* Set jcifs properties we know we want; soTimeout and cachePolicy to 10min.
*/
Config.setProperty( "jcifs.smb.client.soTimeout", "300000" );
- Config.setProperty( "jcifs.netbios.cachePolicy", "600" );
+ Config.setProperty( "jcifs.netbios.cachePolicy", "1200" );
Enumeration e = filterConfig.getInitParameterNames();
while( e.hasMoreElements() ) {
SmbSession.logon( dc, ntlm );
+ if( log.level > 2 ) {
+ log.println( "NtlmHttpFilter: " + ntlm +
+ " successfully authenticated against " + dc );
+ }
} catch( SmbAuthException sae ) {
if( log.level > 1 ) {
log.println( "NtlmHttpFilter: " + ntlm.getName() +
break;
}
- if( log.level > 2 )
+ if( log.level > 3 )
log.println( "NetBIOS: new data read from socket" );
nameTrnId = NameServicePacket.readNameTrnId( rcv_buf, 0 );
response.readWireFormat( rcv_buf, 0 );
response.received = true;
- if( log.level > 2 ) {
+ if( log.level > 3 ) {
log.println( response );
Hexdump.hexdump( log, rcv_buf, 0, in.getLength() );
}
ensureOpen( timeout + 1000 );
socket.send( out );
- if( log.level > 2 ) {
+ if( log.level > 3 ) {
log.println( request );
Hexdump.hexdump( log, snd_buf, 0, out.getLength() );
}
i++;
}
}
- } else if( hostName.hexCode == 0x1D ) {
+ } else if( hostName.hexCode == 0x1D || hostName.hexCode == 0x1C ) {
calledName = SMBSERVER_NAME;
}
}
}
public void close() throws IOException {
- if( log.level > 2 )
+ if( log.level > 3 )
log.println( "close: " + this );
super.close();
}
private static final int LOOKUP_RESP_LIMIT = jcifs.Config.getInt( "jcifs.netbios.lookupRespLimit", 5 );
private static final String DOMAIN = Config.getProperty("jcifs.smb.client.domain", null);
private static final String USERNAME = Config.getProperty("jcifs.smb.client.username", null);
- private static final int DEFAULT_CACHE_POLICY = 30;
- private static final int CACHE_POLICY = Config.getInt( "jcifs.netbios.cachePolicy", DEFAULT_CACHE_POLICY );
+ private static final int CACHE_POLICY = Config.getInt( "jcifs.netbios.cachePolicy", 1200 );
static long dc_list_expiration;
static NbtAddress[] dc_list = null;
}
synchronized( DOMAIN ) {
if( dc_list_expiration < System.currentTimeMillis() ) {
- dc_list = NbtAddress.getAllByName( DOMAIN, 0x1C, null, null );
dc_list_expiration = System.currentTimeMillis() + CACHE_POLICY * 1000L;
+
+ if( SmbTransport.log.level > 2 ) {
+ SmbTransport.log.println( (new java.util.Date()) +
+ ": LOGON_SHARE=" + LOGON_SHARE +
+ ",LOOKUP_RESP_LIMIT=" + LOOKUP_RESP_LIMIT +
+ ",DOMAIN=" + DOMAIN +
+ ",USERNAME=" + USERNAME +
+ ",CACHE_POLICY=" + CACHE_POLICY +
+ ",dc_list.length=" + (dc_list == null ? 0 : dc_list.length) +
+ ",dc_list_range=" + dc_list_range +
+ ",dc_list_index=" + dc_list_index );
+ }
+
+ NbtAddress[] new_dc_list = NbtAddress.getAllByName( DOMAIN, 0x1C, null, null );
+ if( new_dc_list != null && new_dc_list.length >= dc_list_range ) {
+ dc_list = new_dc_list;
+ }
if( dc_list_range > 1 ) {
dc_list_range /= 2; /* shrink dc_list_range */
}
UniAddress dc = new UniAddress( addr );
SmbTransport trans = SmbTransport.getSmbTransport( dc, 0 );
if( USERNAME == null ) {
- if( SmbTransport.log.level > 1 )
+ if( SmbTransport.log.level > 2 )
SmbTransport.log.println( "Default credentials (jcifs.smb.client.username/password) not specified. SMB signing may not work propertly. Skipping DC interrogation." );
trans.negotiate();
} else {
* Session Setup And X Request / Response
*/
- if( transport.log.level > 2 )
+ if( transport.log.level > 3 )
transport.log.println( "sessionSetup: accountName=" + auth.username + ",primaryDomain=" + auth.domain );
SmbComSessionSetupAndX request = new SmbComSessionSetupAndX( this, andx );
synchronized( response ) {
response.useUnicode = useUnicode;
- if( log.level > 2 )
+ if( log.level > 3 )
log.println( "new data read from socket: " + address );
if( response instanceof SmbComTransactionResponse ) {
}
response.received = true;
- if( log.level > 2 )
+ if( log.level > 3 )
log.println( response );
if( response.errorCode != 0 || e.hasMoreElements() == false ) {
response.readWireFormat( in, rcv_buf, 0 );
response.received = true;
- if( log.level > 2 ) {
+ if( log.level > 3 ) {
ServerMessageBlock smb = response;
do {
out.write(snd_buf, 4, length);
out.flush();
- if( log.level > 2 ) {
+ if( log.level > 3 ) {
ServerMessageBlock smb = request;
do {
out.write(snd_buf, 4, length);
out.flush();
- if( log.level > 2 ) {
+ if( log.level > 3 ) {
ServerMessageBlock smb = request;
do {
out.write(snd_buf, 4, length);
out.flush();
- if( log.level > 2 ) {
+ if( log.level > 3 ) {
log.println( request );
if( log.level > 5 ) {
Hexdump.hexdump( log, snd_buf, 0, request.length );
out.write(snd_buf, 4, length);
out.flush();
- if( log.level > 2 ) {
+ if( log.level > 3 ) {
log.println( request );
if( log.level > 5 ) {
Hexdump.hexdump( log, snd_buf, 0, request.length );