diff --git a/utils/spewconlog.in b/utils/spewconlog.in index 07113af6a6bb0ab374f9f71c07888fce4c2ea47c..5c27a33dca92d0ddad6155077209b580bf5e873c 100644 --- a/utils/spewconlog.in +++ b/utils/spewconlog.in @@ -1,6 +1,6 @@ #!/usr/bin/perl -wT # -# Copyright (c) 2005-2015 University of Utah and the Flux Group. +# Copyright (c) 2005-2016 University of Utah and the Flux Group. # # {{{EMULAB-LICENSE # @@ -184,13 +184,6 @@ else { $logname = "$logdir/${node_id}.log"; } -if ($linecount) { - $cmd = "tail -". $linecount -} -else { - $cmd = "cat"; -} - # # Run an ssh command in a child process, protected by an alarm to # ensure that the ssh is not hung up forever if the machine is in @@ -217,7 +210,14 @@ if ($syspid) { # # Now we want to ssh over and cat the file. # +if ($linecount) { + $cmd = "tail -${linecount} $logname | cat -v"; +} +else { + $cmd = "cat -v $logname"; +} + $UID = 0; -system("$SSH -host $tipserver $cmd $logname"); +system("$SSH -host $tipserver $cmd"); $UID = $SAVEUID; exit(($? == 0 ? 0 : 1)); diff --git a/www/spewconlog.php3 b/www/spewconlog.php3 index 0c13e7b0f71f0eefaab604e1bf55156f932c78a8..7e964f9114bffb050664703b4dd51cb68e9347cb 100644 --- a/www/spewconlog.php3 +++ b/www/spewconlog.php3 @@ -1,6 +1,6 @@ - - - Console log for $node_id - -
\n";
+header("Content-Type: text/plain; charset=us-ascii");
+header("X-Content-Type-Options: nosniff");
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Cache-Control: no-cache, must-revalidate");
+header("Pragma: no-cache");
 flush();
 while (!feof($fp)) {
     $string = fgets($fp, 1024);
@@ -125,6 +124,5 @@ while (!feof($fp)) {
 }
 pclose($fp);
 $fp = 0;
-echo "
\n"; ?>