[jcifs] Strange things with % in password

Michael B Allen mba2000 at ioplex.com
Sat Sep 2 01:33:03 GMT 2006


What does the stack trace look like? We just use java.net.URL. If it's
fauling within that you might be stuck.

Also, what is the URL ultimately? The '%()' should be '%25()'

Mike

On Fri, 1 Sep 2006 17:55:30 +0000 (UTC)
Roger <rthomas at stone-ware.com> wrote:

> 
> <%@page import="jcifs.smb.*"%>
> <%@page import="java.net.*"%>
> 
> <%
> 
> String user = "administrator";
> 
> String pwd = URLEncoder.encode( "%()" );
> 
> System.out.println( pwd );
> 
> // #1
> //SmbFile f1 = new SmbFile( "smb://" + user + ":" + pwd + "@10.1.1.10" );
> 
> // #2 Does not give listing...  jcifs.smb.SmbAuthException: Access is denied.
> SmbFile f1 = new SmbFile( "smb://" + user + ":" + pwd + "@10.1.1.10/","/" );
> 
> String[] files = f1.list();
> for( int i=0; i< files.length; i++) {
>   out.println( "<br>" + files[i] );
> }
> %>
> 
> Both calls #1 & #2 yield java.net.MalformedURLException: For input string: "()"
> 
> 
> Change the password to just %
> 
> call #1 works
> call #2 jcifs.smb.SmbAuthException: Access is denied.
> 
> Change the password to m%m
> 
> Both calls yield jcifs.smb.SmbException: smb://administrator:m%25m@10.1.1.10
> java.net.MalformedURLException: String index out of range: 18
> 
> 
> 
> Should I be doing some different encoding?
> 
> Roger
> 


-- 
Michael B Allen
PHP Active Directory SSO
http://www.ioplex.com/


More information about the jcifs mailing list