From 5eb115100ff0febbb2b98dd624534c0f872eadb1 Mon Sep 17 00:00:00 2001 From: johnkeis Date: Mon, 3 Feb 2003 03:31:39 +0000 Subject: [PATCH] Show the log git-svn-id: svn://10.0.0.236/trunk@137294 18797224-902f-48f8-a5cc-f745e15eee43 --- .../webtools/tinderbox3/scripts/showlog.pl | 30 +++++++++++++++++++ mozilla/webtools/tinderbox3/server/showlog.pl | 30 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100755 mozilla/webtools/tinderbox3/scripts/showlog.pl create mode 100755 mozilla/webtools/tinderbox3/server/showlog.pl diff --git a/mozilla/webtools/tinderbox3/scripts/showlog.pl b/mozilla/webtools/tinderbox3/scripts/showlog.pl new file mode 100755 index 00000000000..8ad933402e1 --- /dev/null +++ b/mozilla/webtools/tinderbox3/scripts/showlog.pl @@ -0,0 +1,30 @@ +#!/usr/bin/perl -wT -I. + +use strict; +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use Tinderbox3::Log; + +my $p = new CGI; +my $machine_id = $p->param('machine_id') || ""; +my $logfile = $p->param('logfile') || ""; + +# Detaint machine id / logfile +$machine_id =~ s/[^0-9]//g; +$logfile =~ s/[^0-9A-Za-z\.]//g; +$logfile =~ s/^\.+//g; + +if (!$machine_id || !$logfile) { + die "Must specify machine_id and logfile!"; +} + +my $log_fh = get_log_fh($machine_id, $logfile, "<"); +if (!defined($log_fh)) { + die "No such log found!"; +} + +print $p->header("text/plain"); +while (<$log_fh>) { + print; +} +close $log_fh; diff --git a/mozilla/webtools/tinderbox3/server/showlog.pl b/mozilla/webtools/tinderbox3/server/showlog.pl new file mode 100755 index 00000000000..8ad933402e1 --- /dev/null +++ b/mozilla/webtools/tinderbox3/server/showlog.pl @@ -0,0 +1,30 @@ +#!/usr/bin/perl -wT -I. + +use strict; +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use Tinderbox3::Log; + +my $p = new CGI; +my $machine_id = $p->param('machine_id') || ""; +my $logfile = $p->param('logfile') || ""; + +# Detaint machine id / logfile +$machine_id =~ s/[^0-9]//g; +$logfile =~ s/[^0-9A-Za-z\.]//g; +$logfile =~ s/^\.+//g; + +if (!$machine_id || !$logfile) { + die "Must specify machine_id and logfile!"; +} + +my $log_fh = get_log_fh($machine_id, $logfile, "<"); +if (!defined($log_fh)) { + die "No such log found!"; +} + +print $p->header("text/plain"); +while (<$log_fh>) { + print; +} +close $log_fh;