[jcifs] Problem with combined Session Setup AndX Request and Tree Connect AndX Request

Inggs, Andrew andrew.inggs at thus.net
Thu Mar 21 05:05:19 EST 2002


Hello Everyone

Client: jCIFS 0.6.1, Solaris 8, Java SDK 1.3.1_02
Server: NetApp Release 5.3.6R2

Works:
    bash-2.03$ smbclient //192.168.0.20/omne ***** -W RIPPLE \
    -U Administrator -c dir

Doesn't work:
    bash-2.03$ java -classpath ../jcifs-0.6.1.jar:. -Ddomain=RIPPLE \
    -Dusername=Administrator -Dpassword=***** -Dlog=ALL List \
    smb://192.168.0.20/omne

I'm trying to list the contents of a share on the NetApp using the
jCIFS List example program.  The Session Request and Negotiate
Protocol Request are going fine, but I'm getting an error after the
Session Setup AndX Request, which includes a Tree Connect AndX
Request (see logs below).  The error has class ERRSRV (0x02) and
code ERRerror "Non-specific error code" (0x01).  I can successfully
do the equivalent with smbclient (from Samba 2.2.2).

Based on the packet dumps (using Ethereal), I can see the major
difference between the smbclient session and the jCIFS session is
that in the smbclient session the Session Setup AndX Request and
Tree Connect AndX Request are performed separately.  This means,
for example, that the UID is available for the Tree Connect, which
is not the case for jCIFS.  It is my guess that this is causing
the error.

Is there a way of forcing jCIFS to split the Session Setup AndX
Request and the Tree Connect AndX Request?

Regards,
  Andrew

#properties loaded
#Wed Mar 20 17:28:39 GMT 2002
domain=RIPPLE
log=ALL
username=Administrator
password=*****
java.version=1.3.1_02
java.home=/usr/j2se/jre
java.ext.dirs=/usr/j2se/jre/lib/ext
java.vm.version=1.3.1_02-b02
java.vm.name=Java HotSpot(TM) Client VM
java.vm.info=mixed mode
java.vm.vendor=Sun Microsystems Inc.
java.vm.specification.version=1.0
java.vm.specification.name=Java Virtual Machine Specification
java.vm.specification.vendor=Sun Microsystems Inc.
java.class.version=47.0
java.class.path=../jcifs-0.6.1.jar:.
java.runtime.version=1.3.1_02-b02
java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition
java.specification.version=1.3
java.specification.name=Java Platform API Specification
java.specification.vendor=Sun Microsystems Inc.
java.io.tmpdir=/var/tmp/
java.awt.printerjob=sun.awt.motif.PSPrinterJob
java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
java.awt.fonts=
java.library.path=/usr/bin/../java/bin/../jre/lib/sparc/client:/usr/bin/../j
ava/bin/../jre/lib/sparc::/usr/bin/../java/bin/../jre/../lib/sparc:/usr/lib
java.vendor.url=http://java.sun.com/
java.protocol.handler.pkgs=jcifs
file.separator=/
file.encoding.pkg=sun.io
os.version=5.8
os.name=SunOS
os.arch=sparc
user.name=andrewi
user.dir=/export/spare/src/jcifs_0.6.1/examples
user.timezone=
user.home=/export/home/andrewi
user.language=en
sun.boot.library.path=/usr/j2se/jre/lib/sparc
sun.boot.class.path=/usr/j2se/jre/lib/rt.jar:/usr/j2se/jre/lib/i18n.jar:/usr
/j2se/jre/lib/sunrsasign.jar:/usr/j2se/jre/classes
sun.cpu.endian=big
sun.cpu.isalist=sparcv9+vis sparcv9 sparcv8plus+vis sparcv8plus sparcv8
sparcv8-fsmuld sparcv7 sparc
sun.io.unicode.encoding=UnicodeBig
path.separator=:
line.separator=\n

Mar 20 17:28:39.681 - name service address cache
 0.0.0.0<00> 0.0.0.0<00>/0.0.0.0
 JCIFS0_40_C6<20> JCIFS0_40_C6<20>/192.168.0.40

Mar 20 17:28:39.682 - smb find warning
 find with path=\
Mar 20 17:28:39.777 - smb negotiation warning
 requesting negotiation with 0.0.0.0<00>/192.168.0.20
Mar 20 17:28:39.814 - session service warning
 session established ok with 0.0.0.0<00>/192.168.0.20
Mar 20 17:28:39.831 - smb sent
SmbComNegotiate[command=SMB_COM_NEGOTIATE,received=false,errorCode=0x0000000
0,flags=0x0018,flags2=0x8001,tid=0,pid=45720,uid=0,mid=1,wordCount=0,byteCou
nt=12,wordCount=0,byteCount=12,dialects=NT LM 0.12]

Mar 20 17:28:39.832 - smb sent
00000: FF 53 4D 42 72 00 00 00 00 18 01 80 00 00 00 00  |?SMBr...........|
00010: 00 00 00 00 00 00 00 00 00 00 98 B2 00 00 01 00  |...........?....|
00020: 00 0C 00 02 4E 54 20 4C 4D 20 30 2E 31 32 00     |....NT LM 0.12. |

Mar 20 17:28:39.833 - smb debugging
 new data read from socket
Mar 20 17:28:39.849 - smb packet format warning
byteCount=22 but readBytesWireFormat returned 20
Mar 20 17:28:39.853 - smb received
SmbComNegotiateResponse[command=SMB_COM_NEGOTIATE,received=true,errorCode=0x
00000000,flags=0x0098,flags2=0x8001,tid=0,pid=45720,uid=0,mid=1,wordCount=17
,byteCount=22,wordCount=17,dialectIndex=0,securityMode=0x3,security=user,enc
ryptedPasswords=true,maxMpxCount=50,maxNumberVcs=1,maxBufferSize=8712,maxRaw
Size=65536,sessionKey=0x76B5645E,capabilities=0x000043FD,serverTime=Wed Mar
20 17:15:18 GMT
2002,serverTimeZone=0,encryptionKeyLength=8,byteCount=22,encryptionKey=0x5E6
4B5766066850D,oemDomainName=RIPPLE]

Mar 20 17:28:39.854 - smb received
00000: FF 53 4D 42 72 00 00 00 00 98 01 80 00 00 00 00  |?SMBr...........|
00010: 00 00 00 00 00 00 00 00 00 00 98 B2 00 00 01 00  |...........?....|
00020: 11 00 00 03 32 00 01 00 08 22 00 00 00 00 01 00  |....2...."......|
00030: 5E 64 B5 76 FD 43 00 00 E0 D2 39 CF 32 D0 C1 01  |^d?v?C..??9?2??.|
00040: 00 00 08 16 00 5E 64 B5 76 60 66 85 0D 52 00 49  |.....^d?v`f..R.I|
00050: 00 50 00 50 00 4C 00 45 00 00 00                 |.P.P.L.E...     |

Mar 20 17:28:39.856 - smb tree connect warning
 requesting tree connect with unc=\\192.168.0.20\OMNE,service=?????
Mar 20 17:28:39.865 - smb session setup warning
 requesting session with
accountName=ADMINISTRATOR,accountPassword=,primaryDomain=RIPPLE
Mar 20 17:28:39.906 - smb sent
SmbComSessionSetupAndX[command=SMB_COM_SESSION_SETUP_ANDX,received=false,err
orCode=0x00000000,flags=0x0018,flags2=0x8001,tid=0,pid=45720,uid=0,mid=2,wor
dCount=13,byteCount=111,andxCommand=0x75,andxOffset=172,maxBufferSize=1300,m
axMpxCount=10,vcNumber=1,sessionKey=0,passwordLength=24,unicodePasswordLengt
h=24,capabilities=20,accountPassword=[B at 2981ca,accountName=ADMINISTRATOR,pri
maryDomain=RIPPLE,nativeOs=SunOS,nativeLanMan=foo]

Mar 20 17:28:39.908 - smb andx data
SmbComTreeConnectAndX[command=SMB_COM_TREE_CONNECT_ANDX,received=false,error
Code=0x00000000,flags=0x0018,flags2=0x0000,tid=0,pid=45720,uid=0,mid=0,wordC
ount=4,byteCount=47,andxCommand=0xFF,andxOffset=0,disconnectTid=false,passwo
rdLength=1,password=,path=\\192.168.0.20\OMNE,service=?????]

Mar 20 17:28:39.911 - smb sent
00000: FF 53 4D 42 73 00 00 00 00 18 01 80 00 00 00 00  |?SMBs...........|
00010: 00 00 00 00 00 00 00 00 00 00 98 B2 00 00 02 00  |...........?....|
00020: 0D 75 00 AC 00 14 05 0A 00 01 00 00 00 00 00 18  |.u.?............|
00030: 00 18 00 00 00 00 00 14 00 00 00 6F 00 46 17 A9  |...........o.F.?|
00040: F4 C9 C3 25 02 AA B4 38 CC 87 B7 71 D6 63 92 9F  |???%.??8?.?q?c..|
00050: D0 AF 5C 89 93 93 69 5F F0 04 BA 3A 0C 2F C5 55  |??\...i_?.?:./?U|
00060: A8 40 03 3E FB 92 C5 E6 F9 06 A6 16 A6 00 41 00  |?@.>?.???.?.?.A.|
00070: 44 00 4D 00 49 00 4E 00 49 00 53 00 54 00 52 00  |D.M.I.N.I.S.T.R.|
00080: 41 00 54 00 4F 00 52 00 00 00 52 00 49 00 50 00  |A.T.O.R...R.I.P.|
00090: 50 00 4C 00 45 00 00 00 53 00 75 00 6E 00 4F 00  |P.L.E...S.u.n.O.|
000A0: 53 00 00 00 66 00 6F 00 6F 00 00 00 04 FF 00 00  |S...f.o.o....?..|
000B0: 00 00 00 01 00 2F 00 00 5C 00 5C 00 31 00 39 00  |...../..\.\.1.9.|
000C0: 32 00 2E 00 31 00 36 00 38 00 2E 00 30 00 2E 00  |2...1.6.8...0...|
000D0: 32 00 30 00 5C 00 4F 00 4D 00 4E 00 45 00 00 00  |2.0.\.O.M.N.E...|
000E0: 3F 3F 3F 3F 3F 00                                |?????.          |

Mar 20 17:28:39.912 - smb debugging
 new data read from socket
Mar 20 17:28:39.914 - smb received
SmbComSessionSetupAndXResponse[command=SMB_COM_SESSION_SETUP_ANDX,received=t
rue,errorCode=Non-specific error
code,flags=0x0098,flags2=0x8001,tid=0,pid=45720,uid=0,mid=2,wordCount=0,byte
Count=0,andxCommand=0xFF,andxOffset=0,isLoggedInAsGuest=false,nativeOs=,nati
veLanMan=,primaryDomain=]

Mar 20 17:28:39.915 - smb received
00000: FF 53 4D 42 73 02 00 01 00 98 01 80 00 00 00 00  |?SMBs...........|
00010: 00 00 00 00 00 00 00 00 00 00 98 B2 00 00 02 00  |...........?....|
00020: 00 00 00                                         |...             |

Exception in thread "main" jcifs.smb.SmbException: Non-specific error code
	at jcifs.smb.SmbTransport.send(SmbTransport.java:507)
	at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:149)
	at jcifs.smb.SmbSession.send(SmbSession.java:124)
	at jcifs.smb.SmbTree.treeConnect(SmbTree.java:121)
	at jcifs.smb.SmbTree.sendTransaction(SmbTree.java:50)
	at jcifs.smb.SmbFile.sendTransaction(SmbFile.java:467)
	at jcifs.smb.SmbFile.list(SmbFile.java:1021)
	at jcifs.smb.SmbFile.list(SmbFile.java:1009)
	at List.main(List.java:31)




More information about the jcifs mailing list