[jcifs] Passwords longer than 14 characters

Zalewski, Michael J (Michael)** CTR ** mjzalewski at lucent.com
Wed Apr 10 07:17:06 EST 2002


I get the following stack trace when I try to use JCIFS with a password
length longer than 14 characters.

java.lang.ArrayIndexOutOfBoundsException
	at java.lang.System.arraycopy(Native Method)
	at jcifs.smb.SmbSession.getPreNTLMResponse(SmbSession.java:52)
	at
jcifs.smb.SmbComSessionSetupAndX.writeParameterWordsWireFormat(SmbComSession
SetupAndX.java:59)
	at
jcifs.smb.AndXServerMessageBlock.writeAndXWireFormat(AndXServerMessageBlock.
java:102)
	at
jcifs.smb.AndXServerMessageBlock.writeWireFormat(AndXServerMessageBlock.java
:72)
	at jcifs.smb.SmbTransport.send(SmbTransport.java, Compiled Code)
	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, Compiled Code)
	at jcifs.smb.SmbFile.queryPath(SmbFile.java:748)
	at jcifs.smb.SmbFile.exists(SmbFile.java:803)
	...

Anyone know of a work-around?

Using JCIFS 0.6b9 from Java 1.2.2 in WebSphere.  Calling the SmbFile.exists
like this:

SmbFile testFile = new SmbFile(
"smb://domain;user:a_very_long_password@machine/share/testfile");
testFile.exists();

This works fine if the password is correct and 14 characters or less.
It throws an expected SmbException if the password is incorrect.
(SmbException.ERRnoaccess)
It throws the above exception if the password is longer than 14 characters,
whether or not the password is correct.

Michael Zalewski
IBM Global Services
(973) 386-4667





More information about the jcifs mailing list