NetBIOS Names (Was: Re: Directory listing in libsmbclient.so)
sharpe at ns.aus.com
Sun Dec 31 03:46:48 GMT 2000
At 03:59 PM 12/29/00 -0600, Christopher R. Hertel wrote:
>> Although specific implementations may limit it more, RFC 1001 seems to
>> indicate that, in fact, NetBIOS names are handled as binary, really,
>> and there are no invalid characters in them at all.
Ummm, I think the defining document here has to be the original IBM
documentation on NetBIOS ... While I have misplaced my copy of the 1985 IBM
PC Network Technical Reference, I copied information from it into Special
Edition, Using Samba, and I quote:
<quote verbatim="not quite">
NetBIOS names are always converted to uppercase when sent to other systems,
and may consist of any character, except:
- Any character less than a space (0x20)
- the characters " . / \ [ ] : | < > + = ; ,
While MS have bent the spec a bit (cf \001\002_MSBROWSE_\002\001), the
above would seem to indicate that an '@' is a legit character in a NetBIOS
name, while ':' or '[' or ']' are not.
I do not know of any documents that relax this spec WRT NetBIOS names.
> This is then munged
>> up into ASCII later, so the first stage at which the name has invalid
>> characters is the full-length encoded version (from RFC 1001):
>> For example, the NetBIOS name "The NetBIOS name" in the NetBIOS
>> scope "SCOPE.ID.COM" would be represented at level one by the
>> ASCII character string:
>> Ugh. We can't very well make that the URI syntax.
>:) This is why the RFC-proposed syntax never caught on. BTW, there is
>an error in the above translation. To quote my own junk:
> RFC 1001 provides an example of First Level Encoding in Section 14.1.
> The string "The NetBIOS name" is translated to:
> Decoding this string, however, we get "Tge NetBIOS tame".
> Perhaps it's a secret message.
> The correct translation would be:
>> Since both the workgroup and the scope could potentially contain
>> anything at all, there is no possible way to really tell them apart.
>According to the RFCs, the scope labels should conform to the preferred
>DNS naming syntax. That is, start with alpha, followed by alphanumeric or
>a dash, and end with alphanumeric. Also, they *must* be no more than 63
>characters long, and are compared without regard to case.
>Unfortunately, the Windows systems I've tried allow you to enter just
>about any garbage string you like in the Scope field. Ick.
>> (Who thought that up?)
>They were trying to be compatible with DNS best practices. It's a kludge,
>and it didn't work.
>> Given the situation, I think Chris mentioned
>> the only viable solution: Demand a specific character be escaped if
>> used in the workgroup or scope name. Since NT is already starting
>> to sing a different tune when it sees a ".", that may be the best
>> nominee for the job.
>> Just to summarize, I think that leaves two syntaxes:
>> (broswing) smb://[workgroup[.scope]]/
>> (specific) smb://[[domain;]user[:password]@]server/[share/[path/][file]]
>The server name also needs to have a scope, as in:
>This is nasty but true. As with any NetBIOS name, the name exists
>*within* a scope, so the scope must be specified. In the above, the
>first step will be to use the NetBIOS Name Service to resolve the server
>name to an IP address so that packets may be sent. We need to send to
>the correct IP address, of course.
>Now the wierd thing is that in Microsoft's implementaton the scope string
>is *not* included in the Session Service (TCP/139) SESSION SETUP REQUEST
>packet. If you do include it, I think it sends back a "Called name not
>found" message. My reading of the RFCs is that MS got this bit wrong,
>but the section is ambiguous enought that I forgive them.
>PS. See: http://ubiqx.org/cifs/
> That's my documentation on the workings of NBT. More to come.
>Christopher R. Hertel -)----- University of Minnesota
>crh at nts.umn.edu Networking and Telecommunications Services
> Ideals are like stars; you will not succeed in touching them
> with your hands...you choose them as your guides, and following
> them you will reach your destiny. --Carl Schultz
Richard Sharpe, sharpe at ns.aus.com
Samba (Team member, www.samba.org), Ethereal (Team member, www.zing.org)
Contributing author, SAMS Teach Yourself Samba in 24 Hours
Author, Special Edition, Using Samba
More information about the samba-technical