fix defect 3393889, allow longhostname in policy table

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13140 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2012-06-21 16:11:06 +00:00
parent 65f12a5022
commit d0e29a67e6

View File

@ -924,8 +924,8 @@ if ($inet6support) {
unless ($peerhost) { $peerhost = gethostbyaddr($connection->peeraddr,AF_INET); }
$peerfqdn=$peerhost;
if ($domain) {
my $peerhostorg=$peerhost; # save original with domain for validation
if ($domain) {
# strip off domain if set
$peerhost && $peerhost =~ s/\.$domain\.*$//;
} else {
@ -938,7 +938,7 @@ if ($inet6support) {
$peerhost && $peerhost =~ s/-ib\d*$//;
#printf('info'.": xcatd: connection from ".($peername ? $peername . "@" . $peerhost : $peerhost)."\n");
$$progname="xCATd SSL: Instance for ".($peername ? $peername ."@".$peerhost : $peerhost) if $peerhost;
service_connection($connection,$peername,$peerhost,$peerfqdn);
service_connection($connection,$peername,$peerhost,$peerfqdn,$peerhostorg);
xexit(0);
}
$sslclients++; #THROTTLE
@ -1692,6 +1692,7 @@ sub service_connection {
my $peername = shift;
my $peerhost = shift;
my $peerfqdn = shift;
my $peerhostorg = shift;
my $peerport = $sock->peerport;
my %tables=();
#some paranoid measures could reduce a third party abusing stage3 image to attempting to get USER/PASS for BMCs:
@ -1743,7 +1744,7 @@ sub service_connection {
#we have a full request..
#printf $request."\n";
$request="";
if (xCAT::xcatd->validate($peername,$peerhost,$req,\@deferredmsgargs)) {
if (xCAT::xcatd->validate($peername,$peerhost,$req,$peerhostorg,\@deferredmsgargs)) {
$req->{'_xcat_authname'} = [$peername];
$req->{'_xcat_clienthost'} = [$peerhost];
$req->{'_xcat_clientfqdn'} = [$peerfqdn];