From 83334fb3f539066056eef6e4e8bffae6a97e8ad5 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 26 Jul 2012 19:31:13 +0000 Subject: [PATCH] Have getpostscript work with node x509 auth git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13354 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/getpostscript.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/getpostscript.pm b/xCAT-server/lib/xcat/plugins/getpostscript.pm index 0aa00622d..14632dd99 100644 --- a/xCAT-server/lib/xcat/plugins/getpostscript.pm +++ b/xCAT-server/lib/xcat/plugins/getpostscript.pm @@ -61,8 +61,15 @@ sub process_request } my $client; - if ($request->{'_xcat_clienthost'}) { - $client = $request->{'_xcat_clienthost'}->[0]; + if ($::XCATSITEVALS{nodeauthentication}) { #if requiring node authentication, this request will have a certificate associated with it, use it instead of name resolution + unless (ref $request->{username}) { return; } #TODO: log an attempt without credentials? + $client = $request->{username}->[0]; + } else { + unless ($request->{'_xcat_clienthost'}->[0]) { + #ERROR? malformed request + return; #nothing to do here... + } + $client = $request->{'_xcat_clienthost'}->[0]; } if ($client) { ($client) = noderange($client) };