From f5921d7852a72e14d095e2ff6834ba8b30cec7cb Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 20 Oct 2010 18:37:09 +0000 Subject: [PATCH] -Populate a hash of site table attributes for easy lookup in various places git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7895 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatd | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 4c8a16883..48b75ecdb 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -1450,6 +1450,15 @@ sub becomeuser { #If here, unable to validate given credential return undef; } +sub populate_site_hash { + my $sitetab = xCAT::Table->new('site',-create=>0); + unless ($sitetab) { return; } + my @records = $sitetab->getAllAttribs(qw/key value/); + foreach (@records) { + $::XCATSITEVALS{$_->{key}}=$_->{value}; + } +} + sub service_connection { my $sock = shift; @@ -1458,6 +1467,7 @@ sub service_connection { my $peerfqdn = shift; my $peerport = $sock->peerport; my %tables=(); + populate_site_hash(); #some paranoid measures could reduce a third party abusing stage3 image to attempting to get USER/PASS for BMCs: # -Well, minimally, ignore requests if requesting node is not in spconfig mode (stage3) # -Option to generate a random password per 'getipmi' request. This reduces the exposure to a D.O.S. hopefully