From 56455c9f149df7ec524dfb3b561fe4237191f7d9 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 14 Aug 2008 14:27:54 +0000 Subject: [PATCH] -Fix problem where plugins making peer requests would trample their own path back to client git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2026 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatd | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 5e865e0da..444003008 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -208,7 +208,7 @@ if ($inet6support) { #node should be blocked, race condition may occur otherwise #my $pid=xCAT::Utils->xfork(); #unless ($pid) { #fork off the nodeset and potential slowness - plugin_command(\%request,undef,\&convey_response); + plugin_command(\%request,undef,\&build_response); # exit(0); #} } elsif ($text =~ /^unlocktftpdir/) { #TODO: only nodes in install state should be allowed @@ -220,7 +220,7 @@ if ($inet6support) { chmod 0755,"$tftpdir/xcat/$node"; chmod 0644,glob("$tftpdir/xcat/$node/*"); } elsif ($text =~ /^getpostscript/) { - my $reply =plugin_command({command=>['getpostscript'],_xcat_clienthost=>[$node]},undef,\&convey_response); + my $reply =plugin_command({command=>['getpostscript'],_xcat_clienthost=>[$node]},undef,\&build_response); foreach (@{$reply->{data}}) { print $conn $_; } @@ -250,7 +250,7 @@ if ($inet6support) { ); my $pid=xCAT::Utils->xfork(); unless ($pid) { #fork off the nodeset and potential slowness - plugin_command(\%request,undef,\&convey_response); + plugin_command(\%request,undef,\&build_response); xexit(0); } } @@ -326,10 +326,10 @@ if ($inet6support) { $req->{'_xcat_clientport'}=$sport; if (defined($cmd_handlers{"findme"})) { $req->{cacheonly}->[0] = 1; - plugin_command($req,undef,\&convey_response); + plugin_command($req,undef,\&build_response); if ($req->{cacheonly}->[0]) { delete $req->{cacheonly}; - plugin_command($req,undef,\&convey_response); + plugin_command($req,undef,\&build_response); #if ($req) { # $req->{cacheonly}->[0] = 1; # $req->{checkallmacs}->[0] = 1; @@ -719,7 +719,9 @@ sub plugin_command { } unless (defined $child) { die "Fork failed"; } if ($child == 0) { - $parent_fd = $parfd; + if ($parfd) { #If xCAT is doing multiple requests in same communication PID, things would get unfortunate otherwise + $parent_fd = $parfd; + } my $oldprogname=$$progname; $$progname=$oldprogname.": $modname instance"; if ($sock) { close $pfd; }