-Warn users and skip entries that will make DNS unhappy

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3307 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2009-05-07 17:24:13 +00:00
parent f698a132b1
commit 49a31dc5a7

View File

@ -242,6 +242,11 @@ sub process_request
{
($canonical, $aliases) = split(' ', $names, 2);
$canonical =~ s/\.$netpat//;
#If we feed in names with, say, underscores, bind complains usually due to default check-names behavior. Later, we may should support putting check-names to ignore, but for now let them know it won't work and skip it
unless ($canonical =~ /^[a-z0-9-]+$/i) {
xCAT::MsgUtils->message("E", {errorcode=>[1],error=>["$canonical contains invalid characters, skipping entry"]}, $callback, 1);
next LINE;
}
if ($Cnames{$canonical} != 1)
{
printf DOMAIN "%-20s IN CNAME %s.%s.\n", $canonical,
@ -264,6 +269,10 @@ sub process_request
($canonical, $aliases) = split(' ', $names, 2); # separate out aliases
next if ($dontdodomains && $canonical =~ /\./); # skip domain names
$canonical =~ s/$Domainpattern//; # strip off domain if there is one
unless ($canonical =~ /^[a-z0-9-]+$/i) {
xCAT::MsgUtils->message("E", {errorcode=>[1],error=>["$canonical contains invalid characters, skipping entry"]}, $callback, 1);
next;
}
$Hosts{$canonical} .= $addr . " "; # index addresses by canonical name
$Aliases{$addr} .= $aliases . " "; # index aliases by address
$Comments{"$canonical-$addr"} = $comment;
@ -328,6 +337,10 @@ sub process_request
{
next;
}
unless ($alias =~ /^[a-z0-9-]+$/i) {
xCAT::MsgUtils->message("E", {errorcode=>[1],error=>["$canonical alias $alias contains invalid characters, skipping entry"]}, $callback, 1);
next;
}
my $aliasforallnames = 0;
if ($numaddrs > 1)