[jcifs] Annoying SMB URL question.

Christopher R. Hertel crh at ubiqx.mn.org
Sat Dec 7 04:54:18 EST 2002


Good replies, everyone.  Thanks for the feedback.

...and no, Conrad, it's not my "goal" to break existing parsing (much).
Just to rattle cages and make people wonder about my twisted thinking.

Also, the existing implementations are still random enough that it's
likely that a little fixing will need to be done anyway.  ;)


Matthew, you asked...

On Fri, Dec 06, 2002 at 11:24:33AM -0500, Matthew Tippett wrote:
:
> As an extension of that - chris, can you clarify if on a given NetBIOS 
> namespace you can have two machines with the same name but on two 
> different Domains.

Assuming NBT, not naked TCP...

If the two machines are in the same scope (another way of saying
'namespace', in this context) then they are not permitted to have the same
unique name (with the broken exception of the <1D> unique names...)

The NT Domain system is build on top of the NBT layer, so it is above the 
naming layer.  So, even if the machines are in different NT Domains (or in 
separate Workgroups) they may not have the same NetBIOS name.

Now, if you're talking about naked TCP then you are also talking about W2K
Domains (Active Directory stuff).  That's a whole 'nother EPA Supersite.

Under Active Directory, the namespace is mapped to the DNS namespace, and 
the Active Directory authentication scheme is also mapped to DNS 
namespace.  Thus, under W2K, you *can* have two machines with the same 
hostname, as long as they are in separate (DNS/AD) domains.

Got that?  :)

> Which begs the question, if the domain is used for authentication, why 
> not leave the user field in the userinfo section of the URL as
> 
>   DOMAIN%5Cuser
> 
> Since the domain is an integral part of the credentials.

The application (the client parsing the URL string and converting it into
SMB calls) needs to parse the NTDomain from the username.  You are right
that we could have chosen to separate the two using an escaped backslash
or, perhaps an escaped percent sign.  Instead, we found that the
semi-colon did not need to be escaped in the username field and could be 
used as a separator.

It just seemed easier and more readable to use the semicolon.

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