[jcifs] Problem using jcifs with iSeries (OS400) NetServer

Michael B Allen mba2000 at ioplex.com
Mon Mar 29 02:55:10 GMT 2004


Egan Done said:
> Micahel,
>
> Here is a trace of the failed jcifs request.  The server seems to be
> responding to the negotiate request.
>
> (See attached file: failed.pcap)
>
> - Egan

The SMB_COM_NEGOTIATE response is malformed. The ByteCount field claims
the payload is 18 but it's only 15. The reason windows works with the
server is because it's using port 445 whereas jCIFS is using port 139. The
negotiate responses both have a ByteCount of 18 but only the response on
port 445 has the domain name encoded. The port 139 response just has 7 nul
bytes. Actually windows would probably work with port 139 too because the
NetBIOS header length field is correct. JCIFS doesn't use that field
because of the NbtSocket abstraction hides it. Oddly enough port 445
support is slated for 0.9 as is the revisiting/possible removal of the
NbtSocket abstraction.

Mike

PS: You might ask IBM if they have a patch. It's really a bug on their
end. JCIFS is just fickle about the WordCount and ByteCount fields being
correct.

>                       "Michael B Allen"
>                       <mba2000 at ioplex.c        To:       "Egan Done"
> <Egan_Done at otpp.com>
>                       om>                      cc:       jcifs at samba.org
>                                                Subject:  Re: [jcifs]
> Problem using jcifs with
> iSeries (OS400) NetServer
>                       2004/03/17 03:12
>                       PM
>
>
>
>
>
>
> Egan Done said:
>> Mar 17 14:37:27.406 - session service warning
>>  session established ok with 0.0.0.0<00>/172.25.7.6
>> Mar 17 14:37:27.416 - smb sent
>>
> SmbComNegotiate[command=SMB_COM_NEGOTIATE,received=false,errorCode=0x00000000,fl
>
>>
> ags=0x0018,flags2=0x8003,tid=0,pid=19779,uid=0,mid=1,wordCount=0,byteCount=12,wo
>
>> rdCount=0,dialects=NT LM 0.12]
>>
>> Mar 17 14:37:27.416 - smb sent
>> 00000: FF 53 4D 42 72 00 00 00 00 18 03 80 00 00 00 00  |
> SMBr...........|
>> 00010: 00 00 00 00 00 00 00 00 00 00 43 4D 00 00 01 00
> |..........CM....|
>> 00020: 00 0C 00 02 4E 54 20 4C 4D 20 30 2E 31 32 00     |....NT LM 0.12.
> |
>>
>> Mar 17 14:37:27.416 - smb transport warning
>>  new data read from socket
>> Mar 17 14:37:42.928 - netbios socket closed
>> NbtSocket[addr=0.0.0.0<00>/172.25.7.6,port=139,localport=2927]
>> Exception in thread "main" jcifs.smb.SmbException: Timeout waiting for
>> response
>> from server. TCHR400C/172.25.7.6
>>         at jcifs.smb.SmbTransport.send(SmbTransport.java:735)
>>         at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:955)
>
> The server isn't answering the negotiation. It might be a dialect problem.
> JCIFS only supports the NT LM 0.12 dialect. Can you get a packet capture
> of net use working successfully (preferrably from Win2000)? If the server
> doesn't answer that's really the only way to see what the server is
> expecting from it's clients.
>
> http://jcifs.samba.org/capture.html
>
> Mike
>
>



More information about the jcifs mailing list