[jcifs] Connection bug in jarapac?

Martin D. Pedersen mdp at visanti.com
Mon Oct 18 07:16:58 GMT 2004


I'm playing with the examples in jarapac.
They seems to work fine when connecting to a Samba server.
But when I connect to a Windows 2000 or 2003 server, I get an :
jcfis.smb.SmbException : No process is on the other end of the pipe.

I figured that something is causing the server side to close the connection.
With some Ethereal debugging i tracked the problem down to:

    private void connect() throws IOException {
        bound = true;
        try {
            context = createContext();
            ConnectionOrientedPdu pdu = context.init(
                    new PresentationContext(0, getSyntax()),
            if (pdu != null)
            while (!context.isEstablished()) {
                if ((pdu = context.accept(receive())) != null)
-->                  send(pdu);

At this point jarapac sends and Auth3 response, which causes the server 
to return a nca_proto_error.
When the example then tries to eg. call NetrShareEnum it receives a 

A simple hack to get up and running seems to be to remove the send(pdu) 
while (!context.isEstablished()) {
                pdu = context.accept(receive());

The jarapac is now able to connect both to Samba,Win2000 and Win2003.
But I'm not at all into the SMB protocol, so this might not at all be a 
working fix

-- mdp

More information about the jcifs mailing list