[jcifs] Some things about listing shares...

Michael B. Allen miallen at eskimo.com
Tue Nov 19 18:36:55 EST 2002

On Mon, 18 Nov 2002 15:58:24 -0600
"Christopher R. Hertel" <crh at ubiqx.mn.org> wrote:

> I'm playing with 0.7.0b8 (as I ought).
> I aimed a share query at a node on a remote subnet, like so:
>   $ java List smb://
> ...and got back an SmbAuthException.  Not surprising, but here's what I 
> noticed...
> 1) The NBT Session Request and the SMB NegProt both work fine.  The first 
>    SessionSetupAndX, however, tries to log in as GUEST with a primary 
>    domain of "?".  The response is an error message.  I get:
>      Error Class: Server Error (0x02)
>      Error Code:  Unknown SRV error (0x8bf)
>    I've done as much digging as I can, and I can't figure out what that 
>    error code might be.

8bf = 2239 and net helpmsg says its "The user account has expired"
but I'm not sure that makes a whole lot of sense.

> 2) jCIFS tries again, this time trying to log on as the 'anonymous' user.
>    The login and tree connect succeed, but then the Windows box
>    (OS=[Windows NT 4.0] Server=[NT LAN Manager 4.0]) returns an Access 
>    Denied.  That accounts for the SmbAuthException.
> 3) The type of query that we are sending is not the same as the type of 
>    query that an NT or W2K client sends when querying a W2K server (and 
>    possibly others).  jCIFS uses the same transaction as smbclient, but 
>    smbclient (and W98, in my tests) never see share names longer than 12 
>    or 13 charcters.

Niether can jCIFS. This is a limitation in the NetShareEnum RAP function.

>    It appears that there must be a newer transaction (or 
>    RPC... I haven't checked), used by NT and beyond, that provides more 
>    complete information.

Yes it uses the NetrShareEnum p104 in Lukes book. This is probably the
#1 reason to get RPC going.

> Those are not necesarily related, but I'm digging into browsing now...
> Anyone with a deeper understanding of this stuff, please comment.
> Chris -)-----
> -- 
> 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

A  program should be written to model the concepts of the task it
performs rather than the physical world or a process because this
maximizes  the  potential  for it to be applied to tasks that are
conceptually  similar and, more important, to tasks that have not
yet been conceived. 

More information about the jcifs mailing list