#120 Can't make a node called "b"

v1.9.2
closed-fixed
nobody
None
5
2007-08-13
2006-12-12
Anonymous
No

The nodename is stored in /etc/nodename, which is a context-
dependent symlink (CDSL). In this case, the context is node
number, which means each node you add will have it's own view
of /etc/nodename containing its own hostname. To learn more
about CDSLs, please see /usr/share/doc/openssi/cdsl.

Enter a nodename or (?): b
Enter a nodename or (?):

The problem is in Clustertab.pm, validate_node:

sub validate_name {
my $value = shift;
return 0 unless defined $value;
return 0 unless $value =~
/^[[:alpha:]][-[:alnum:]]{0,22}[[:alnum:]]$/;
# SSI_XXX: is the name clusterwide unique?
# SSI_XXX: does the name match a local interface? (or CVIP for clustername)
return 1;
}

Regexp Should be something like

/^[[:alpha:]]([-[:alnum:]]+)*$/ &&
length ($value) < whatever

Discussion

  • Brian J. Watson

    Brian J. Watson - 2006-12-12

    Logged In: YES
    user_id=16302
    Originator: NO

    The nodename has to end with an [:alnum:], per the RFC 810 requirements for a hostname. Maybe this test could work for all valid nodenames, including single character ones (hasn't been tested):

    return 0 unless
    $value =~ /^[[:alpha:]][-[:alnum:]]*$/ &&
    $value =~ /[[:alnum:]]$/ &&
    length($value) <= 24;

     
  • Nobody/Anonymous

    Logged In: NO

    Rfc810 says:

    <name> ::= <letter>[*[<letter-or-digit-or-hyphen>]<letter-or-digit>]

    Or, as a regexp:

    /^[[:alpha:]]([-[:alnum:]]*[[:alnum:]])?$/

    Ugly, but should work

     
  • Brian J. Watson

    Brian J. Watson - 2006-12-13

    Logged In: YES
    user_id=16302
    Originator: NO

    Looks correct. We could also work in the length requirement with the {0,22} term:

    /^[[:alpha:]]([-[:alnum:]]{0,22}[[:alnum:]])?$/

     
  • John Hughes

    John Hughes - 2007-01-15

    Logged In: YES
    user_id=166336
    Originator: NO

    Fixed by my commit of 2007/01/15.

     
  • Nobody/Anonymous

    Logged In: NO

    Reason for this is explained on the comment (press ?): Node names must have at least 2 and at most 24 characters, starting with a letter of alphabet a to z. Clearly shown on verbose mode. Shorter names might cause problems on other parts.

     
  • John Hughes

    John Hughes - 2007-03-23

    Logged In: YES
    user_id=166336
    Originator: NO

    Uh, "nobody", the comment may "explain" this, but it's incorrect - a node name is supposed to be a Rfc810 name, and the RFC says:

    <name> ::= <letter>[*[<letter-or-digit-or-hyphen>]<letter-or-digit>]

    So a 1 letter node name is valid.

     
  • Roger Tsang

    Roger Tsang - 2007-08-13
    • milestone: --> v1.9.2
    • status: open --> closed-fixed
     

Log in to post a comment.