A deadlock was identified in SmbTransport.java very similar to the last one found about a year ago. A simple but significant change has been made that greatly simplifies synchronization in the transport layer. It eliminates this issue as well as the extra synchronization introduced to fix the previous problem. It is an elemental change however so proceed with caution (Update Jun 1: Reports are good; no problems).
Two new packages have been introduced. The jcifs.ntlmssp package now contains some NTLMSSP base classes. This code is used by the NtlmHttpFilter as well as the new NtlmHttpURLConnection class for transparently enabling your HTTP and HTTPS client to negotiate NTLM authentication with IIS, the jCIFS Filter, Sqiud proxy, etc. The other new package is jcifs.https which just contains the HTTPS protocol handler necesary for proper protocol handler registration. Please read the document entitled Using jCIFS NTLM Authentication for HTTP Connections for important information about this new functionality.
Some open flags internal to SmbFileOutputStream have been changed to permit unusual named pipe modes to be used that previously were not considered.
Previously it was possible for jCIFS to report incorrect (old) file size and modification time values after writing to the file. The attribute expiration period is now reset in SmbFileOutputStream.write() to prevent this problem. It is also possible to work around the problem by setting jcifs.smb.client.attrExpirationPeriod = 0 although doing so may impact performace.
Previously using the SmbFileInputStream.skip() method meant data would be read and then discarded.
This implementation of this method has been changed so that data is not read; there will be no IO to the server.
This might be useful to applications that wish to resume a large download from a certain offset within a file in the event of a network failure.
The SmbFile.isDirectory() method has been changed to return false if the target does
not exist. Previously this would return true which is inconsistent with
java.io.File.
More refinement to the NTLM HTTP authentication code has been applied.
There is also a fix for listing hosts from Windows ME/98/95 local master
browsers.
Some NtlmHttpFilter issues were reported by several users with Windows 98 clients.
Eric has provided a new NtlmSsp.java that permits the Filter to work correctly with these
clients.
Under certain conditions the SmbSession.logon() method could
accept an incorrect password because of how SmbSession
objects are shared internally. This mehtod will now always
throw a SmbAuthException if incorrect credentials are
supplied. A minor change has also been made to the behavior of the
NtlmHttpFilter and NetworkExplorer servlet that
provokes the Network Password dialog to be redisplayed repeatedly
until correct credentials are entered by the user.
A serious bug was found that causes an
ArrayIndexOutOfBoundsException to be thrown if the len
parameter of SmbFileOutputStream.write() is 1501, 1502, or
1503. Also, the FILE_SHARE_READ, FILE_SHARE_WRITE,
FILE_SHARE_DELETE, and FILE_NO_SHARE constants have
been exposed in SmbFile to specify a shareAccess
parameter to SmbFileOutputStream and SmbFile to
restrict other processes from accessing files opened by jCIFS. The
SmbFileOutputStream now supports offsets greater than 4GB.
Three bugs have been fixed, regarding filenames with '#' signs in them, the getInputStream(), getLastModified(), getDate(), and getContentLength() methods of the URLConnection implementation, and isExists() incorrectly returning false.
Revision 04 of the SMB
URL draft specification is now available.
This release of the jCIFS client includes new functionality specifically targeting Web applications as well as some critical SMB URL fixes and feature improvements. They are outlined in greater detail below. Enjoy!
All documentation has been completely reviewed. See the links under Developer Information at the top of the list to the left.
This release fixes a name service deadlock. It was thought to have
been fixed in the previous release but an update was accidentally
lost. This is the same name service deadlock described in both the
stable and beta series for the past two releases. It should really be
gone now.
Java 1.3 is now required with jcifs-0.7.0b4 or later. This is because
we are now using the Java 1.3 variant of java.net.URL.set() for
all URL handling internally and the 1.2 implementation does not support
our requirements. Attempting to use Java 1.2 or below will result in an
error message printed to System.err and unknown protocol:
smb exceptions. If you must use Java 1.2 or 1.1 jcifs-0.6.8
will work great as usual minus The URL Bug.
To resolve URL issues, jcifs now uses java.net.URL internally throughout. This has changed the behavior of the client in very significant ways and it will undoubtedly break older code. These issues are:
The NtlmHttpFilter and NetworkExplorer should
now work whereas before some users (largely Tomcat users) were
experiencing problems. The NTLM HTTP Authentication code is now
stateless and has been verified to work with both Resin and Tomcat
at least. An NtlmServlet has been contributed that can
negotiated NTLM SSP using older pre-2.3 servlet containers. Previously,
negotiated credentials could not be used to access SMB resources
with NetworkExplorer. This works now, and it is remarkably
fast, however you cannot filter NetworkExplorer with the
NtlmHttpFilter. The NTLM
HTTP Authentication document has been updated.
There's a nasty bug in Win2K that causes jCIFS to hang. The PrimaryDomain field in the SMB_COM_SESSION_SETUP_ANDX response is not properly terminated with two zeros like it should be when Unicode is negotiated. I have patched jCIFS to only look for one zero which should eliminate this problem.
Unfortunately there are three other bugs that have not been attended to as they all relate to the rather complicated issue of the SMB URL: