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

Jelmer Vernooij jelmer at samba.org
Sat Oct 30 10:10:06 MDT 2010


On Sat, 2010-10-30 at 20:04 +0400, Matthieu Patou wrote:
> 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 ...
That function does allow -, it will return false if there are characters
that are not in that list. - is part of the list.

Cheers,

Jelmer


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-cvs/attachments/20101030/1fdd1945/attachment-0001.pgp>


More information about the samba-cvs mailing list