[jcifs] SMB URL

Christopher R. Hertel crh at ubiqx.mn.org
Tue Jul 9 14:37:29 EST 2002


On Tue, Jul 09, 2002 at 12:17:10AM -0400, Allen, Michael B (RSCH) wrote:
:
> > It would become:
> > 
> >   NetBIOS Name = "foo%2Ebar"
> >       Scope ID = "what.snu.com"
> >          Share = "share"
> > 
> > ...and then you would convert the %2E into a dot.
> > 
> 	Right, but if you "export" the decoded URL how do you know if you need
> to re-encode a dot?

You would export the individual fields, yes?  If the NetBIOS Name field 
contains a dot, encode it before rebuilding it into the URL.

That is, to be able to build an SMB URL, you would need to be given each 
field separately.  Otherwise, how do you know whether "foo;crh:bar at snu" 
should be read as:

  ntdomain = "foo"
  username = "crh"
  password = "bar"
      host = "snu"

or:

  userinfo = "foo%3Bcrh%3Abar"
      host = "snu"

or:

      host = "foo%3Bcrh%3Abar%40snu"

If the user enters the string as "foo;crh:bar at snu" then you assume the
first, because there are no escapes.  If you tare that down to it's
components, then you need to re-escape the components as you build them
back into a URL string.  So, if you have:

      host = "foo.bar"
   scopeID = "what.snu.com"
     share = "share"

then in order to export it as a URL string you would need to first escape
the dot in "foo.bar" (which means knowing that it is a NetBIOS name rather 
than a DNS name).

I think I made that sound more convoluted than it really is.

Chris -)-----

-- 
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