[jcifs] SmbURL's with @'s in the path portion

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Thu Nov 15 11:59:33 EST 2001


In accordance with the SMB URL IETF draft all characters not of the defined set suitable for
use with URLs (I beleive the HTTP spec was referenced here) must be encoded with the
standard %code encoding.

Unfortunately, jCIFS sort of side steps this. I have been avoiding applying
java.net.URLEncoder/decoder to all components of the path because it's a costly. I wanted to
see how long I could get away with it. Look's like I've been busted :~)

Mike

> -----Original Message-----
> From:	rjw [SMTP:rob at wygand.com]
> Sent:	Wednesday, November 14, 2001 7:46 PM
> To:	jcifs at samba.org
> Subject:	[jcifs] SmbURL's with @'s in the path portion
> 
> Mike,
> 
> Just found something else... if I have a url that looks like the following:
> 
> smb://rob:password@hostname/sharename/foo/Mom @ Cannes/lotr.jpg
> 
> jCIFS balks with a hostname not found exception. I believe I found the 
> reason, though.
> 
> Line 176 of SmbURL does a lastIndexOf ("@") to get the index of the @. 
> It then looks after the @ for the hostname. So, in this case, it's 
> trying to find a server named " Cannes", I think.
> 
> Is there any issue that I am unaware of with making this an indexOf 
> instead of lastIndexOf()?
> 
> rjw
> -- 
> "They that can give up essential liberty to obtain a little
>   temporary safety deserve neither liberty nor safety."
> 
> 





More information about the jcifs mailing list