[jcifs] there is a mistake in jcifs-1.2.9.jar about SmbFile constructor

Michael B Allen mba2000 at ioplex.com
Sat Dec 9 05:43:17 GMT 2006


On Sat, 09 Dec 2006 09:08:24 +0800
"Paul Ling" <drpaulling at msn.com> wrote:

> Hi,
> 
> I think there is a mistake in jcifs-1.2.9.jar about SmbFile Constructor that 
> accept a parent SmbFile and sub name as parameter, if the parent SmbFile has 
> user password and the password include the charactors "%,?, 
> ,\,/,#,@,^,|,<,>,`,Tab".
> 
> The reason is at jcifs.smb.Handler.parseURL(), Line 94:
>         try {
>             userinfo = unescape( userinfo );
>         } catch( UnsupportedEncodingException uee ) {
>         }
> 
> The userInfo of java.net.URL has been unescaped. it should not be unescape 
> here again.

Since when? I distinctly recall users escaping these characters so if
what you say is true they would have reported this problem long ago. Can
you post a very simple example that clearly illustrates the failure? One
that does not use java.net.URI?

> BTW, the userInfo of java.net.URI is escaped.

I think switching to URI could be dangerous since java.net.URL is hooked
deeply into these APIs. Any change in semantics and we could be trying to
hash out subtle bugs for weeks. That sounds like something for JCIFS 2.0.

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


More information about the jcifs mailing list