[jcifs] Re: SMB URL

Stephan Kulow coolo at kde.org
Wed Mar 26 18:20:17 EST 2003


Am Tuesday 25 March 2003 22:12 schrieb Michael B. Allen:
> Please look at the jCIFS mailing list for discussions in February
> about the SMB URL. There was an interesting discussion about Unicode
> hanlding. The problem of course is that URLs require characters outside
> of ASCII to be escaped with %HH hex escapes. This is of course not very
> reasonable with SMB URLs so hex escaping is not required. In practice
> this should not be a problem because these URLs are not submitted as
> parameters to text based RPCs like HTTP GET requests.
Correct. As long as libsmbclient (or any cifs client for that matter) doesn't
use a URL itself for communication, it doesn't need to encode any URL part.

>
> We did reach an important conclusion that would be influential to anyone
> writing an SMB URL parser. That is, even though SMB URLs do not require
> Unicode characters be escaped (for practical reasons) they should be
> able to decode escaped Unicode characters. This begs the question; how
> do you escape Unicode characters? The prevailing answer appears to be
> specified in the W3C IRI documents which suggest each escape should be
> treated as a byte in a UTF-8 multibyte sequence.
>
> Otherwise, the SMB URL is reasonably well defined. Unicode handling was
> the only remaining issue I believe. The jCIFS client implements all of
> this functionality minus the decoding of escaped UTF-8 sequences.
>
> Please join the jCIFS mailing list if you have specific questions. We
> have had many interesting discussions there about the SMB URL, we have
> implemented it completely, and there are three people who understand it
> quite well. Chris and Eric have the brains. Me type.
>
> I'm not familiar with the state of the libsmbclient SMB URL handling.
Well, as you say yourself, the client needs to be able to decode escaped
characters (you always say unicode characters, but that's not the only 
problem, you need to descape '?', '=', '@' and similar characters too, that
do have a specific meaning in URLs (I named my test machine @home
just to annoy parsers :)

So while libsmbclient doesn't need code to escape any characters as it
never returns URLs, but just names or data, it urgently needs code to
descape them.

The other part missing is the query handling. Currently libsmbclient relies
on ~/.smb/smb.conf for the workgroup (which is a bit problematic when you
want to copy files from one workgroup to another from a linux client ;(
Above that it gives a ?WORKGROUP=COOLO - no such file

Greetings, Stephan



More information about the jcifs mailing list