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


Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to