[jcifs] SMB URL

Christopher R. Hertel crh at ubiqx.mn.org
Tue Jul 9 09:46:40 EST 2002


On Sun, Jul 07, 2002 at 09:26:22PM -0400, Allen, Michael B (RSCH) wrote:
> 
> 
> > -----Original Message-----
> > From:	Conrad Minshall [SMTP:conrad at apple.com]
> > 
> > >- In the current draft, you can specify:
> > >
> > >    smb://<NetBIOS_NAME>.<ScopeID>
> > >
> > >  I'm thinking that it would be better to disallow the specification of
> > >  the scope in the server field.  Instead, you would have to write the
> > >  above as:
> > >
> > >    smb://<NetBIOS_NAME>?SCOPE=<ScopeID>
> > 
> > URLs, once created, are likely to persist.  So code for the "dot" form will
> > persist.  The "dot" form seems to povide all the functionality, so why add
> > complexity, by having an alternate form?
> > 
> 	Without scope a name can be resolved 3 ways; it's a FQDN, a workgroup
>       name, or a NetBIOS server name.

Some things...

We have this:
  smb_server = [ smb_userinfo "@" ] smb_srv_name [ ":" port ]

as the current syntax.  smb_userinfo is the username, authentication 
domain, and password...all known stuff.  The bit we are talking about here 
is the smb_srv_name field (non-terminal, in BNF speak).

In keeping with URLs in general, the smb_srv_name field is a superset of 
the 'host' non-terminal, defined in RFC 2396 and updated in RFC 2732.  It 
looks like this:

  host = hostname | IPv4address | IPv6reference

So it allows for IPv4 and IPv6 addresses.  The hostname part can be a host
name or partially qualified DNS name.  In either case it needs to be
resolved by the local resolver, which is outside the scope of the URL.

To all of that, we want to add support for NetBIOS names.  This brings us
back to the point of debate:

   Should the "official" specification allow inclusion of the Scope ID as 
   part of the name or should it be a parameter added at the end via the
   query mechanism--or both?

Syntactically, we can rule out the IPv4 and IPv6 addresses.  In the 
earlier drafts I suggested that the syntax would allow something like 
192.168.24.83 to be interpreted as a NetBIOS name or even a NetBIOS name 
with scope ID.  Having worked on some code that does resolution, I've 
decided that anyone who would use a name that looks like an IP address 
should be eaten by a grue.

That leaves us with names only.  What I've done in the latest draft is
disallow the dot character in a NetBIOS name (just the NetBIOS name part,
not the scope).  That means that in the rare case that a NetBIOS name 
contains a dot, it would have to be escaped.  So, given something like:

  smb://foo.bar.edu/

The name could only be interpreted in two ways:

1) It's a DNS name.
2) It's the NetBIOS name "FOO" in scope "BAR.EDU".

Syntax-wise, those would be the only options.  Consider also:

  smb://foo/

This is really the same situation.  The string "foo" is either an
unqualified DNS name (a host name) or a NetBIOS name.  That simplifies the
code quite a bit.  If you really wanted the NetBIOS name "FOO.BAR" in 
scope "EDU" you would write:

  smb://foo%2Ebar.edu/

How do people feel about that solution?

>       Considering I have never actually seen anyone ever use scope I
>       think it would be better if we leave if out of the authority
>       component.

If the name is handled as described above, it reduces the number of 
queries to a reasonable number.  Given the "old" way of doing it, you are 
very right.  Both scope ID and a dot in the NetBIOS name are rare, so I 
think that--if the solution above is acceptable--we may have a work around 
that works for everyone.

I am trying to see how many ?query options can be removed so that, as Mike 
suggested, we can start with a minimal set.

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