From 863ba244c3b4a00545fe0be129aed9983b350e49 Mon Sep 17 00:00:00 2001 From: leiaibj Date: Mon, 18 Feb 2013 02:04:08 +0000 Subject: [PATCH] The function isValidHostname, it can not detect illegal hostname like 'a=b-c' git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15197 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/NetworkUtils.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index 6f65ea2e2..ce6c82985 100755 --- a/perl-xCAT/xCAT/NetworkUtils.pm +++ b/perl-xCAT/xCAT/NetworkUtils.pm @@ -2188,7 +2188,7 @@ sub isValidHostname my ($class, $hostname) = @_; if ($hostname =~ /^[a-z0-9]/){ if ($hostname =~ /[a-z0-9]$/){ - if ($hostname =~ /[\-a-z0-9]+/){ + if ($hostname =~ /^[\-a-z0-9]+$/){ return 1; } }