[ ssic-linux-Bugs-1613866 ] Can't make a node called "b"

"SourceForge.net" <[email protected]>
Newsgroups gmane.linux.cluster.ssic.devel
Message-ID <[email protected]>
Bugs item #1613866, was opened at 2006-12-12 06:08
Message generated for change (Comment added) made by rogertsang
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=405834&aid=1613866&group_id=32541

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
>Group: v1.9.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Can't make a node called "b"

Initial Comment:
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

----------------------------------------------------------------------

>Comment By: Roger Tsang (rogertsang)
Date: 2007-08-12 20:07

Message:
Logged In: YES 
user_id=1246761
Originator: NO

http://article.gmane.org/gmane.linux.cluster.ssic.cvs/8163

----------------------------------------------------------------------

Comment By: John Hughes (hughesj)
Date: 2007-03-23 10:46

Message:
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.


----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2007-03-01 05:13

Message:
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.

----------------------------------------------------------------------

Comment By: John Hughes (hughesj)
Date: 2007-01-15 05:12

Message:
Logged In: YES 
user_id=166336
Originator: NO

Fixed by my commit of 2007/01/15.

----------------------------------------------------------------------

Comment By: Brian J. Watson (bjbrew)
Date: 2006-12-13 10:49

Message:
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:]])?$/

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2006-12-13 07:52

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

----------------------------------------------------------------------

Comment By: Brian J. Watson (bjbrew)
Date: 2006-12-12 16:42

Message:
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;

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=405834&aid=1613866&group_id=32541

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.