case sensitive hostnames?

Christopher R. Hertel crh at nts.umn.edu
Fri Jun 15 19:32:07 GMT 2001


DNS names are case-insensitive.

Regarding NetBIOS names:  By convention, these are also case-insensitive
and should always be converted to Upper Case before they are encoded.  
This is not explained in the RFCs, it's just what happens on the wire.

In Samba, we decode NBT NetBIOS names and then use a case-insensitive
comparison when comparing names.  Windows assumes all names are uppercased
before being encoded.  From my tests, it seems that they do not bother to
decode names, they simply compare the fully-encoded NBT name string
straight off the wire. 

There is a speed advantage to not decoding the name, and because of the 
workings of the encoded format, the encoded name can be compared using 
something as simple as strcmp().

The problem, though, is that if anyone ever *did* try to use lower case
characters in a name the results would be a mess.  Consider "TPOT" vs. 
"TPot" as NetBIOS names.  Samba would read these two names as equal, while
Windows would see them as different. 

TPOT == \x20FEFAEPFECACACACACACACACACACACAAA\0
TPot == \x20FEFAGPHECACACACACACACACACACACAAA\0
                ^^^^
Chris -)-----

> Are there any systems out there that have case sensitive hostnames?
> I'm pretty sure that internet hostnames are not case sensitive and
> there is some code in Samba that assumes this.  The problem is that
> doing multiple unecessary dns lookups compounds the effect of
> broken dns servers.
> 
> Does anyone know if this will break some of the lesser known Samba
> ports?
> 
> 
> Tim.
> 


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




More information about the samba-technical mailing list