From 980c554a4c9830967e95e9d1ccb7d419b5869fc9 Mon Sep 17 00:00:00 2001 From: vallard Date: Thu, 25 Feb 2010 03:08:32 +0000 Subject: [PATCH] got rid of some errors that would happen if request was made from xCAT UI" git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5294 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatd | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 59c8a5f8b..714bcd967 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -674,17 +674,17 @@ if ($inet6support) { if ($domain) { # strip off domain if set - $peerhost =~ s/\.$domain\.*$//; + $peerhost && $peerhost =~ s/\.$domain\.*$//; } else { # otherwise just strip off whatever comes after the first dot - $peerhost =~ s/^.*?\.//; + $peerhost && $peerhost =~ s/^.*?\.//; } - $peerhost =~ s/-eth\d*$//; - $peerhost =~ s/-myri\d*$//; - $peerhost =~ s/-ib\d*$//; + $peerhost && $peerhost =~ s/-eth\d*$//; + $peerhost && $peerhost =~ s/-myri\d*$//; + $peerhost && $peerhost =~ s/-ib\d*$//; #printf('info'.": xcatd: connection from ".($peername ? $peername . "@" . $peerhost : $peerhost)."\n"); - $$progname="xCATd SSL: Instance for ".($peername ? $peername ."@".$peerhost : $peerhost); + $$progname="xCATd SSL: Instance for ".($peername ? $peername ."@".$peerhost : $peerhost) if $peerhost; service_connection($connection,$peername,$peerhost,$peerfqdn); xexit(0); } @@ -1383,7 +1383,10 @@ sub service_connection { if ($req->{noderange} && defined($req->{noderange}->[0])) { $$progname .= " to ".$req->{noderange}->[0]; } - $$progname .= " for ".($peername ? $peername ."@".$peerhost : $peerhost); + + if($peerhost){ + $$progname .= " for ".($peername ? $peername ."@".$peerhost : $peerhost); + } if ($req->{command}->[0] eq "authcheck") { #provide a method for UI to verify a user without actually requesting action my $resp; if ($peername or $peername eq "0") {