Invalid Netbios Names? Re: [SCM] Samba Shared Repository - branch master updated

Matthieu Patou mat at samba.org
Sat Oct 30 10:04:55 MDT 2010


Hi Metze
>> Date:   Thu Oct 28 13:09:51 2010 +0400
>>
>>      provision: when deriving netbiosname from hostname force the netbiosname to be compliant
>>
>>      It means no space/_/-/@.... and less than 16 chars.
> What's wrong with '-'? It's allowed in netbios and dns names.
>
> See http://support.microsoft.com/kb/909264
Well the test that check if it's a valid netbiosname checks for the 
absence of '-':

def valid_netbios_name(name):
     """Check whether a name is valid as a NetBIOS name. """
     # See crh's book (1.4.1.1)
     if len(name) > 15:
         return False
     for x in name:
         if not x.isalnum() and not x in " !#$%&'()-.@^_{}~":
             return False
     return True

So I guess this function is wrong.

Because I made my function based on this test ...

-- 
Matthieu Patou
Samba Team        http://samba.org
Private repo      http://git.samba.org/?p=mat/samba.git;a=summary




More information about the samba-technical mailing list