SMB URL

Stephan Kulow coolo at kde.org
Wed Mar 26 09:04:00 GMT 2003


Am Wednesday 26 March 2003 09:42 schrieb Michael B. Allen:
> On Wed, 26 Mar 2003 08:20:17 +0100
>
> Stephan Kulow <coolo at kde.org> wrote:
> > > 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
>
> Sure.
>
> > 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.
>
> I wouldn't say "urgently". JCIFS is getting along without it ok at the
> moment. It depends where their being used. One such case is when they
So it can't browse my host named @home? :)

> are embedded in the PATH_INFO of an HTTP URL however it would also be
> necessary to provide an escape function to the author so that the URLs
> are properly escaped using UTF-8.
Well, I browse within konqueror and KDE does have a correct URL handling,
so either I descape these in the mapping to libsmbclient or I fix it where it
belongs: in libsmbclient.

>
> > 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
>
> I'm not sure I understand this. Do you mean domain? Does libsmbclient
> support the forms:
>
>   smb://domain;user:pass@server/share/path/to/file
Yes. But what if a server appears in two workgroups? Even if you have 
anonymous access to both of them. The DRAFT specifies WORKGROUP
query for that, libsmbclient doesn't even code yet to ignore queries.

>
> and
>
>   smb://workgroup/
It does. And when I enter a directory within that, I can't simply make sure
the URLs are unique in using smb://host/?WORKGROUP=workgroup

I think, I would even have gone for smb:///?WORKGROUP=workgroup
to make this even less ambiguous.

Greetings, Stephan



More information about the samba-technical mailing list