[jcifs] browsing a smaller network using netserverenum2

Christopher R. Hertel crh at ubiqx.mn.org
Fri Feb 4 19:38:01 GMT 2005


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?  When I try, it sends two SessionSetupAndX+TreeConnectAndX 
requests, both of which are successful, and then closes the TCP connection 
and throws an exception:

Exception in thread "main" jcifs.smb.SmbAuthException: Logon failure: 
unknown user name or bad password.
        at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:292)
        at jcifs.smb.SmbSession.send(SmbSession.java:246)
        at jcifs.smb.SmbTree.treeConnect(SmbTree.java:134)
        at jcifs.smb.SmbFile.connect(SmbFile.java:834)
        at jcifs.smb.SmbFile.connect0(SmbFile.java:797)
        at jcifs.smb.SmbFile.doNetEnum(SmbFile.java:1634)
        at jcifs.smb.SmbFile.listFiles(SmbFile.java:1604)
        at jcifs.smb.SmbFile.listFiles(SmbFile.java:1514)
        at ListFiles.main(ListFiles.java:12)

smbclient works fine with anonymous credentials:

$ smbclient -L duplo -U "" -N
Domain=[UBIQX] OS=[Unix] Server=[Samba 2.2.8a]

        Sharename       Type      Comment
        ---------       ----      -------
        backup          Disk      Backup space (e'mail backup)
        IPC$            IPC       IPC Service (Mail server (Samba 2.2.8a))
        ADMIN$          Disk      IPC Service (Mail server (Samba 2.2.8a))
Domain=[UBIQX] OS=[Unix] Server=[Samba 2.2.8a]

        Server               Comment
        ---------            -------
        DELENN               Family Workstation (Kitchen; W98)
        DUPLO                Mail server (Samba 2.2.8a)
        FAVOG                CRH's Desktop (Samba 3.0.9-2.1.5-SUSE)
        HULK                 Home Fileserver (Samba 3.0.9-2.1-SUSE)
        OMEGA                You have always been here.  (Study; W98)
        SNAPPER              Snap server--jCIFS testing
        SULU                 NSLU2 Test System

        Workgroup            Master
        ---------            -------
        UBIQX                DUPLO

What am I missing?

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