[jcifs] SmbAuthException while calling list() on a SmbFile("smb://").

Michael P. Jung suriver at gmail.com
Mon Sep 6 21:11:54 GMT 2004


I just realized that JCIFS seams to ignore the jcifs.Config property
for the loglevel. When using System.setProperty it results in a lot
more output: (loglevel set to 4)

For me it looks like it is connected to the server, gets the list of
hosts but throws the SmbAuthException anyways:

#JCIFS PROPERTIES
#Mon Sep 06 23:08:00 CEST 2004
java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition
sun.boot.library.path=/usr/lib/j2sdk1.4-sun/jre/lib/i386
java.vm.version=1.4.2_03-b02
java.vm.vendor=Sun Microsystems Inc.
java.vendor.url=http\://java.sun.com/
path.separator=\:
java.vm.name=Java HotSpot(TM) Client VM
file.encoding.pkg=sun.io
user.country=US
sun.os.patch.level=unknown
java.vm.specification.name=Java Virtual Machine Specification
user.dir=/home/mpjung/eclipse-workspace/lx.intranet
java.runtime.version=1.4.2_03-b02
java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
java.endorsed.dirs=/usr/lib/j2sdk1.4-sun/jre/lib/endorsed
os.arch=i386
java.io.tmpdir=/tmp
line.separator=\n
java.vm.specification.vendor=Sun Microsystems Inc.
os.name=Linux
sun.java2d.fontpath=
java.library.path=/usr/lib/j2sdk1.4-sun/jre/lib/i386/client\:/usr/lib/j2sdk1.4-sun/jre/lib/i386\:/usr/lib/j2sdk1.4-sun/jre/../lib/i386
java.specification.name=Java Platform API Specification
java.class.version=48.0
java.util.prefs.PreferencesFactory=java.util.prefs.FileSystemPreferencesFactory
os.version=2.6.6-brain
user.home=/home/mpjung
user.timezone=
java.awt.printerjob=sun.print.PSPrinterJob
file.encoding=ANSI_X3.4-1968
java.specification.version=1.4
jcifs.util.loglevel=4
user.name=mpjung
java.class.path=/home/mpjung/eclipse-workspace/lx.intranet/bin\:/home/mpjung/eclipse-workspace/jetty-4.2.20RC0/lib/javax.servlet.jar\:/home/mpjung/eclipse-workspace/jetty-4.2.20RC0/lib/org.mortbay.jetty.jar\:/home/mpjung/eclipse-workspace/jcifs/jcifs-1.0.0.jar\:/home/mpjung/eclipse-workspace/org.apache.commons.net/commons-net-1.2.2.jar
java.vm.specification.version=1.0
sun.arch.data.model=32
java.home=/usr/lib/j2sdk1.4-sun/jre
java.specification.vendor=Sun Microsystems Inc.
user.language=en
java.vm.info=mixed mode
jcifs.netbios.hostname=lx_scanner
java.version=1.4.2_03
java.ext.dirs=/usr/lib/j2sdk1.4-sun/jre/lib/ext
sun.boot.class.path=/usr/lib/j2sdk1.4-sun/jre/lib/rt.jar\:/usr/lib/j2sdk1.4-sun/jre/lib/i18n.jar\:/usr/lib/j2sdk1.4-sun/jre/lib/sunrsasign.jar\:/usr/lib/j2sdk1.4-sun/jre/lib/jsse.jar\:/usr/lib/j2sdk1.4-sun/jre/lib/jce.jar\:/usr/lib/j2sdk1.4-sun/jre/lib/charsets.jar\:/usr/lib/j2sdk1.4-sun/jre/classes
java.vendor=Sun Microsystems Inc.
file.separator=/
java.vendor.url.bug=http\://java.sun.com/cgi-bin/bugreport.cgi
sun.cpu.endian=little
sun.io.unicode.encoding=UnicodeLittle
jcifs.netbios.wins=192.168.1.68
sun.cpu.isalist=
NameQueryRequest[nameTrnId=1,isResponse=false,opCode=QUERY,isAuthAnswer=false,isTruncated=false,isRecurAvailable=false,isRecurDesired=true,isBroadcast=true,resultCode=0,questionCount=1,answerCount=0,authorityCount=0,additionalCount=0,questionName=..__MSBROWSE__.<01>,questionType=0x0020,questionClass=IN,recordName=null,recordType=0x0000,recordClass=0x0000,ttl=0,rDataLength=0]
NetBIOS: new data read from socket
00000: 00 01 01 10 00 01 00 00 00 00 00 00 20 41 42 41  |............ ABA|
00010: 43 46 50 46 50 45 4E 46 44 45 43 46 43 45 50 46  |CFPFPENFDECFCEPF|
00020: 48 46 44 45 46 46 50 46 50 41 43 41 42 00 00 20  |HFDEFFPFPACAB.. |
00030: 00 01                                            |..              |

NameQueryResponse[nameTrnId=1,isResponse=true,opCode=QUERY,isAuthAnswer=true,isTruncated=false,isRecurAvailable=true,isRecurDesired=true,isBroadcast=false,resultCode=0,questionCount=0,answerCount=1,authorityCount=0,additionalCount=0,questionName=null,questionType=0x0000,questionClass=IN,recordName=..__MSBROWSE__.<01>,recordType=0x0020,recordClass=IN,ttl=259200,rDataLength=6,addrEntry=..__MSBROWSE__.<01>/192.168.1.68]
00000: 00 01 85 80 00 00 00 01 00 00 00 00 20 41 42 41  |............ ABA|
00010: 43 46 50 46 50 45 4E 46 44 45 43 46 43 45 50 46  |CFPFPENFDECFCEPF|
00020: 48 46 44 45 46 46 50 46 50 41 43 41 42 00 00 20  |HFDEFFPFPACAB.. |
00030: 00 01 00 03 F4 80 00 06 80 00 C0 A8 01 44        |....?.....??.D  |

requesting negotiation with 0.0.0.0<00>/192.168.1.68
session established ok with 0.0.0.0<00>/192.168.1.68
SmbComNegotiate[command=SMB_COM_NEGOTIATE,received=false,errorCode=The
operation completed
successfully.,flags=0x0018,flags2=0xC003,signSeq=0,tid=0,pid=37135,uid=0,mid=1,wordCount=0,byteCount=12,wordCount=0,dialects=NT
LM 0.12]
new data read from socket: 0.0.0.0<00>/192.168.1.68
byteCount=30 but readBytesWireFormat returned 28
SmbComNegotiateResponse[command=SMB_COM_NEGOTIATE,received=true,errorCode=The
operation completed
successfully.,flags=0x0088,flags2=0xC801,signSeq=0,tid=0,pid=37135,uid=0,mid=1,wordCount=17,byteCount=30,wordCount=17,dialectIndex=0,securityMode=0x2,security=share,encryptedPasswords=true,maxMpxCount=50,maxNumberVcs=1,maxBufferSize=16644,maxRawSize=65536,sessionKey=0x00002A97,capabilities=0x0080E3FD,serverTime=Mon
Sep 06 23:08:00 CEST
2004,serverTimeZone=65416,encryptionKeyLength=8,byteCount=30,encryptionKey=0xE7C29C4D8E249571,oemDomainName=LANEXTREME]
treeConnect: unc=\\192.168.1.68\IPC$,service=?????
sessionSetup: accountName=GUEST,primaryDomain=?
SmbComSessionSetupAndX[command=SMB_COM_SESSION_SETUP_ANDX,received=false,errorCode=The
operation completed
successfully.,flags=0x0018,flags2=0xC003,signSeq=0,tid=0,pid=37135,uid=0,mid=2,wordCount=13,byteCount=41,andxCommand=0x75,andxOffset=102,snd_buf_size=16644,maxMpxCount=10,VC_NUMBER=1,sessionKey=0,passwordLength=0,unicodePasswordLength=0,capabilities=84,accountName=GUEST,primaryDomain=?,NATIVE_OS=Linux,NATIVE_LANMAN=jCIFS]
SmbComTreeConnectAndX[command=SMB_COM_TREE_CONNECT_ANDX,received=false,errorCode=The
operation completed
successfully.,flags=0x0018,flags2=0x0000,signSeq=0,tid=0,pid=37135,uid=0,mid=0,wordCount=4,byteCount=47,andxCommand=0xFF,andxOffset=0,disconnectTid=false,passwordLength=1,password=,path=\\192.168.1.68\IPC$,service=?????]
new data read from socket: 0.0.0.0<00>/192.168.1.68
SmbComSessionSetupAndXResponse[command=SMB_COM_SESSION_SETUP_ANDX,received=true,errorCode=The
operation completed
successfully.,flags=0x0088,flags2=0xC801,signSeq=0,tid=1,pid=37135,uid=0,mid=2,wordCount=3,byteCount=71,andxCommand=0x75,andxOffset=112,isLoggedInAsGuest=true,nativeOs=Unix,nativeLanMan=Samba
3.0.6-Debian,primaryDomain=LANEXTREME]
SmbComTreeConnectAndXResponse[command=SMB_COM_TREE_CONNECT_ANDX,received=true,errorCode=The
operation completed
successfully.,flags=0x0088,flags2=0xC801,signSeq=0,tid=1,pid=37135,uid=0,mid=2,wordCount=3,byteCount=7,andxCommand=0xFF,andxOffset=0,supportSearchBits=true,shareIsInDfs=false,service=IPC,nativeFileSystem=]
treeConnect: unc=\\192.168.1.68\IPC$,service=?????
sessionSetup: accountName=,primaryDomain=
SmbComSessionSetupAndX[command=SMB_COM_SESSION_SETUP_ANDX,received=false,errorCode=The
operation completed
successfully.,flags=0x0018,flags2=0xC003,signSeq=0,tid=0,pid=37135,uid=0,mid=3,wordCount=13,byteCount=29,andxCommand=0x75,andxOffset=90,snd_buf_size=16644,maxMpxCount=10,VC_NUMBER=1,sessionKey=0,passwordLength=0,unicodePasswordLength=0,capabilities=84,accountName=,primaryDomain=,NATIVE_OS=Linux,NATIVE_LANMAN=jCIFS]
SmbComTreeConnectAndX[command=SMB_COM_TREE_CONNECT_ANDX,received=false,errorCode=The
operation completed
successfully.,flags=0x0018,flags2=0x0000,signSeq=0,tid=0,pid=37135,uid=0,mid=0,wordCount=4,byteCount=47,andxCommand=0xFF,andxOffset=0,disconnectTid=false,passwordLength=1,password=,path=\\192.168.1.68\IPC$,service=?????]
new data read from socket: 0.0.0.0<00>/192.168.1.68
SmbComSessionSetupAndXResponse[command=SMB_COM_SESSION_SETUP_ANDX,received=true,errorCode=The
operation completed
successfully.,flags=0x0088,flags2=0xC801,signSeq=0,tid=2,pid=37135,uid=0,mid=3,wordCount=3,byteCount=71,andxCommand=0x75,andxOffset=112,isLoggedInAsGuest=true,nativeOs=Unix,nativeLanMan=Samba
3.0.6-Debian,primaryDomain=LANEXTREME]
SmbComTreeConnectAndXResponse[command=SMB_COM_TREE_CONNECT_ANDX,received=true,errorCode=The
operation completed
successfully.,flags=0x0088,flags2=0xC801,signSeq=0,tid=2,pid=37135,uid=0,mid=3,wordCount=3,byteCount=7,andxCommand=0xFF,andxOffset=0,supportSearchBits=true,shareIsInDfs=false,service=IPC,nativeFileSystem=]
Exception in thread "main" jcifs.smb.SmbAuthException: Logon failure:
unknown user name or bad password.
	at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:192)
	at jcifs.smb.SmbSession.send(SmbSession.java:148)
	at jcifs.smb.SmbTree.treeConnect(SmbTree.java:134)
	at jcifs.smb.SmbFile.connect(SmbFile.java:833)
	at jcifs.smb.SmbFile.connect0(SmbFile.java:796)
	at jcifs.smb.SmbFile.doNetEnum(SmbFile.java:1617)
	at jcifs.smb.SmbFile.listFiles(SmbFile.java:1587)
	at jcifs.smb.SmbFile.listFiles(SmbFile.java:1497)
	at lx.intranet.scanner.SmbScanner.main(SmbScanner.java:22)


More information about the jcifs mailing list