[jcifs] Re: SMB URL encoding/decoding

Michael B Allen mballen at erols.com
Sun Feb 24 16:00:54 EST 2002

On Sat, 23 Feb 2002 22:09:59 -0600
"Christopher R. Hertel" <crh at ubiqx.org> wrote:

> The two '@'s are a problem, I suppose.  The way that this would be parsed
> is:
> scheme == "SMB"
> server == "Administrator:P at ss@msmith1"
> path   == "src/docs/api/jcifs/smb/SmbFile.html"
> The <server> field would then be further parsed into <userinfo>@<hostport>,
> probably based on the first '@'.  That would give:
> userinfo == "Administrator:P"
> hostport == "ss at msmith1"
> Probably not what was intended.
> One of those '@'s should probably be escaped.  I'll assume it's the first.
> That gives:  "Administrator:P%40ss at msmith1" which results in:
> userinfo == "Administrator:P%40ss"
> hostport == "msmith1"

Actually it should look for the '/' like you describe but then search
*backwords* from there for the '@' so that even if there are more than
one '@' it will still work because '@' will not appear in the server
name. This way, only an unescaped '/' in the password would cause it to
fail. This is really much better than what we're doing now the more I
think about it. No one ever uses '/' in a password. I can't beleive I
didn't do that originally. It would have been soooooo much easier.


May The Source be with you.

More information about the jcifs mailing list