[jcifs] jcifs bug?

Michael B Allen mballen at erols.com
Sat Feb 23 17:02:34 EST 2002


On Sat, 23 Feb 2002 02:32:39 +0100
James Nord <teilo at teilo.net> wrote:

> Bernie Wieser wrote:
> 
> >Some user has a file called "seti at home.txt" -
> >URL is smb://HI137/D$/Documents and Settings/ryar/seti at home.txt
> >
> I think that you need to URL escape that url
> 
> smb://HI137/D$/Documents%20and%20Settings/ryar/seti@home.txt

Spaces are '+'. If you really want to fully encode this, I think it would be:

smb://HI137/D%24/Documents+and+Settings/ryar/seti%40home.txt

> 
> You may need to escape the second @, from my understanding of  RFC 1738 
> you do not need to but IANAE and I'n not up-to-date on the smb URL to 
> say this.

Actually it's the @ sign that's important to the SMB URL. You can get
away without decoding anything except '@' but because we must apply the
decoding you also now have to encdode the special escape characters used
by the URL encoding itself which are '+' and '%'.

> 
> (I guess usernames can contain a / so that's why everything up to the @ 
> is callsed as "username"@home.txt

Exactly.

> 
> ftp://user:pass@foo.com/some/dir/im@home/text.txt is valid no?

Nope. We search for the '@' from the end.

> But Seeing as a '/' is a reserver char in usernames/pass it would need 
> to be escaped here?

We don't do encoding/decoding on everything after the server
component. This may not be perfectly legit according to the language
layers but there's no way I'm going to URL encode my password and server
names cannot have '@' signs in them so...

> 
> /James
> 
> 
> >
> >jcifs blows a chunk
> >
> >java.net.UnknownHostException: home.txt
> >        at jcifs.UniAddress.getByName(UniAddress.java:249)
> >
> >B.
> >
> 
> 
> 


-- 
May The Source be with you.




More information about the jcifs mailing list