[jcifs] browsing a smaller network using netserverenum2

Christopher R. Hertel crh at ubiqx.mn.org
Fri Feb 4 22:20:00 GMT 2005


On Fri, Feb 04, 2005 at 04:49:20PM -0500, Michael B Allen wrote:
> On Fri, 4 Feb 2005 13:38:01 -0600
> "Christopher R. Hertel" <crh at ubiqx.mn.org> wrote:
> 
> > On Fri, Jan 28, 2005 at 04:09:30PM -0500, Michael B Allen wrote:
> > > On Fri, 28 Jan 2005 11:02:51 -0600
> > > Rana Basheer <ranabasheer at gmail.com> wrote:
> > > 
> > > > did not find any( I issued a wins name request broadcast ). Please let
> > > > me know how I can browse for machines in a small network like mine
> > > 
> > > You should be able to. If you run examples/ListFiles like:
> > > 
> > > java -cp jcifs.jar:... ListFiles smb://
> > > 
> > > what happends?
> > 
> > Okay...  I'm confused here.  How do I get ListFiles to work with anonymous
> > 
> > credentials?
> 
> I think the smb:// URL is treated a little special. I think it tries the
> supplied creds but then falls back to anonymous. If you want to explicitly
> specify anonymous I think there is an NPA for that that can be passed to
> the SmbFile constructor. You might also be able to do smb://@server/path/,
> or perhaps smb://;@server/path/, or maybe smb://:@server/path/. Try
> different permutations or look at the code to see how anonymous
> credentials are repesented (I think it's an empty string).

I am supplying nul credentials in most of the ways you've suggested plus
the use of empty strings in my jcifs.prp file.  What I'm seeing on the
wire is that jCIFS is logging in successfully with anonymous
credentials--twice!  It then closes the TCP connection.  Huh?  :)

I can send along a trace and a log dump.  Easy enough to replicate, 
though.

Note that I am specifically avoiding giving jCIFS any credentials to use.  
If I use a .prp file, it has:

jcifs.smb.client.domain =
jcifs.smb.client.username =
jcifs.smb.client.password =
jcifs.netbios.baddr = 192.168.101.255

In most tests I'm leaving the .prp file out and just using raw defaults.

I've tried "smb://", "smb://:@/", and "smb://;:@/", all with the same 
results.

Chris -)-----

-- 
"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org


More information about the jcifs mailing list