Sun Oct 31 00:58:04 EDT 2004
jcifs-1.1.1 released

The  jcifs.smb.client.logonShare  (and  thus  the JCIFSACL NTLM HTTP Filter
example)  did  not  work. It would not restrict users to those found in the
ACL it would permit all authenticated users. This has been fixed.

A  bug  was  discovered  and  fixed  in  the named pipe code. If a specific
sequence  of reads were performed the pipe could become corrupted. This fix
is necessary for multi-pdu DCE requests to work.

A small bug in the new NbtAddress.getAllByName method has been repaired. It
will now broadcast for a name if a WINS address was not provided. 

jcifs-1.1.0 released

The behavior of the firstCalledName/nextCalledName methods has been changed
to try SMBSERVER* first, then the NetBIOS hostname, then the 0x20 name from
a Node Status. It is pretty universal now that SMBSERVER* rules the day and
most  servers  return  failure  with  the  NetBIOS  name  so  this behavior
eliminates a round trip during session establishment.

The  NbtAddress.getByName method has been implemented. This will return the
full  list of RDATA for a name query response. Currently I believe only the
0x1C  domain  lookup  actually  returns  multiple  results.  Note  this  is
different from getAllByAddress which does a node status.

The  socket code in SmbTransport has been modified to open the socket using
the transport thread. This permits the caller of the transport to call wait
for  RESPONSE_TIMEOUT.  This is great if your application has a tendency to
try  to connect to hosts that do not exist. Normally that would take over a
minute  to  timeout. The single threaded SmbCrawler actually performs quite
well with the right properties set.

An SmbSession.getChallengeForDomain() method has been added that returns an
NtlmChallenge  object containing the byte[] challenge and UniAddress of the
domain  controller  from  which  it came. This method will rotate through a
list  of  at  most  jcifs.netbios.lookupRespLimit  addresses  and will only
return  a  challenge  for a responsive server. Unresponsive servers will be
removed from the list until the jcifs.netbios.cachePolicy has expired. This
function  is  used  by  the  NTLM  HTTP  Filter  to  locate suitable domain
controllers.

Because  of  the above rotation there is a greater potential for transports
to  remain  open. Sessions with no activity (this is particularly true with
the  NTLM  HTTP  Filter which really only touches the session once when the
user is authenticated) will be logged off after jcifs.smb.client.soTimeout.

A  read  bug that only manafested itself with a certain EMC server has been
fixed. 

Mon Sep  6 20:44:14 EDT 2004
jcifs-1.0.1 released

The  GUEST  account  fix  broke  guest  access  entirely  for machines that
deliberately  want  it.  So  this  is  the  original  fix but with the test
condition corrected. 

Mon Sep  6 14:59:26 EDT 2004
jcifs-1.0.0 released

Other  than  minor  changes  in  packaging  this code is identical to 0.9.8
released  3 days ago. From now one all development will continue in the 2.0
(?) branch so that the 1.x series remains as stable as possible. 

Thu Sep  2 18:45:35 EDT 2004
jcifs-0.9.8 released

If  the  special  "GUEST"  account is not disabled (almost always is) it is
possible  for  a  bogus  username  to  be  authenticated successfully. This
problem was only partially fixed previously. A clause was incorrectly added
that  was  intended  to  allow  the  username  "guest"  to be authenticated
successfully.  It  is  now  not possible for "guest" to be authenticated at
all.

A  log  message  has  been  added to the NtlmHttpFilter that will be logged
whenever  an  SmbAuthException is triggered and the jcifs.util.log.loglevel
is  greater  than 1. For example, to enable logging authentication failures
with the filter add the following to the filter section in your web.xml. 

    <init-param>
        <param-name>jcifs.util.loglevel</param-name>
        <param-value>2</param-value>
    </init-param>

An  ArrayIndexOutOfBoundsException  that  could occur if NTLMv2 is used but
lmCompatibility was not set to 3 accordingly has been fixed. 

Tue Aug 10 21:25:03 EDT 2004
jcifs-0.9.7 released

It  was  decided that the NTLM HTTP Filter should not set Connection: close
headers,  a  new  SmbFile  constructor has been added and a rogue debugging
statement has been removed. 

--8<--

                                JCIFS
                     The Java CIFS Client Library
                        http://jcifs.samba.org

JCIFS  is  an  Open  Source  client  library  that  implements the CIFS/SMB
networking  protocol  in  100%  Java.  CIFS  is  the  standard file sharing
protocol  on  the  Microsoft Windows platform (e.g. Map Network Drive ...).
This client is used extensively in production on large Intranets. 

REQUIREMENTS:

JCIFS jar file - http://jcifs.samba.org/src/
Java 1.3 or above - http://java.sun.com/products/

INSTALLATION:

Just  add  the  jar  file to you classpath as you would with any other jar.
More specifically:

UNIX:

Go  to  http://jcifs.samba.org and download the latest jar. If you download
the  tgz archive you also get the source code and javadoc API documentation
(see  critical properties discussed on the Overview page). Put it someplace
reasonable and extract it. For example: 

  $ gunzip jcifs-1.0.0.tgz
  $ tar -xvf jcifs-1.0.0.tar

Add  the  jar  to  your classpath. There are two ways to do this. One is to
explicitly set it on the command line when you run your application like:

  $ java -cp myjars/jcifs-1.0.0.jar MyApplication

but  a  more  robust  solution  is  to  export  it  in  your  ~/.profile or
~/.bash_profile like: 

  CLASSPATH=$CLASSPATH:/home/produser/myapp/myjars/jcifs-1.0.0.jar
  export CLASSPATH

WINDOWS:

Go  to  http://jcifs.samba.org and download the latest jar. If you download
the  zip archive you also get the source code and javadoc API documentation
(see  critical properties discussed on the Overview page). Put it someplace
reasonable and extract it with something like Winzip.

Add  the  jar  to  your classpath. There are two ways to do this. One is to
explicitly set it on the command line when you run your application like:

  C:\> java -cp myjars\jcifs-1.0.0.jar MyApplication

but  a  more robust solution would be to change your system environment but
I'm not confident I can tell you accurately how to do that.

It  is  also  common  that  the CLASSPATH be specified in a shell script or
batch file. See the build.bat batch file that runs the Ant build tool as an
example.

USING JCIFS:

In  general  the  public  API  is  extremely simple. The jcifs.smb.SmbFile,
jcifs.smb.SmbFileInputStream, and jcifs.smb.SmbFileOutputStream classes are
analogous     to    the    java.io.File,    java.io.FileInputStream,    and
java.io.FileOutputStream  classes so if you know how to use those it should
be  obvious how to use jCIFS provided you set any necessary properties(such
as WINS) and understand the smb:// URL syntax.

Here's an example to retrieve a file: 

  import jcifs.smb.*;

  jcifs.Config.setProperty( "jcifs.netbios.wins", "192.168.1.230" );
  SmbFileInputStream in = new SmbFileInputStream(
       "smb://dom;user:pass@host/c/My Documents/report.txt" );
  byte[] b = new byte[8192];
  int n;
  while(( n = in.read( b )) > 0 ) {
      System.out.write( b, 0, n );
  }

You can also write, rename, list contents of a directory, enumerate shares,
communicate with Win32 Named Pipe Servers, ...etc.

The  protocol  handler  for  java.net.URL  is also in place which means you
retrieve  files  using the URL class as you would with other protocols. For
example: 

  jcifs.Config.registerSmbURLHandler(); //ensure protocol handler is loaded
  URL url = new URL( "smb://dom;user:pass@host/share/dir/file.doc" );
  InputStream in = url.openStream();

This  will  also work with whatever else uses the URL class internally. For
example  if you use RMI you can serve class files from an SMB share and use
the codebase property:

  -Djava.rmi.server.codebase=smb://mymachine/c/download/myapp.jar

There  are many example programs in the jcifs_1.0.0/examples/ directory. To
execute the Put example you might do: 

  $ java -cp examples:jcifs-1.0.0.jar -Djcifs.properties=jcifs.prp \
                  Put smb://dom;usr:pass@host/share/dir/file.doc
  ##########
  582K transfered

See the API documentation and supplimentary documents in the docs directory
or on the JCIFS website. 

BUILDING JCIFS FROM SOURCE:

The Ant build tool is required to build JCIFS:

   http://jakarta.apache.org/ant/

After  installing Ant just run 'ant' in the JCIFS directory. It should read
the  build.xml  and  present  a  list  of targets. To build a new jar after
modifying the source for example simply type 'ant jar'. 

ACKNOWLEDGEMENTS

Special thanks to Eric Glass for work on NTLM, the NTLM HTTP Authentication
Filter,  and  RPCs.  Thanks  is  also  due  to  the  Samba organization and
Christopher  R.  Hertel  for starting the JCIFS project. Finally, thanks to
users who diagnose problems and provide the critical feedback and solutions
that make the Open Source model great. 
