[jcifs] Bug report?

Christopher R. Hertel crh at ubiqx.mn.org
Wed Apr 27 09:03:11 MDT 2011


J wrote:
> Christopher R. Hertel <crh <at> ubiqx.mn.org> writes:
>> Escape the percent sign.
>>
>> % ==> %25
>>
> 
>   Uhm... I would be able to do it with a simple search-replace but i still have
> doubts: are you proposing a quick hack or a normalized solution?

URL encoding reserves certain characters for use as delimiters, escapes,
etc.  In a URL string, a '%' introduces a hex escape sequence.  It doesn't
matter if it's part of the server name, path, file name, whatever.  The
syntax of the URL string requires that it be interpreted first as a
three-character hex escape.

>   That is: if the user types qwe%72tyuiop... is he typing a 10-chars-long
> password and I must send it unchanged to JCIFS? Or a 12-chars-long password and
> I must send qwe%2572tyuiop to JCIFS?

If it is part of a URL string, then the URL parser should un-escape it,
meaning that the "%72" in "qwe%72tyuiop..." would become 'H'.  I do not
know, off-and, whether the method you referenced in your first e'mail is
part of the URL parser or not.  It it is part of the URL handling, then it
would make sense that it un-escapes the string passed into it (on the
assumption that the string was extracted from the URL).  If it is not part
of the URL handling, then the string should already be un-escaped before it
is passed into the method.

Chris -)-----

-- 
"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org


More information about the jCIFS mailing list