Francois Gouget : testbot: Use MakeOfficialURL() in non-CGI scripts.
Alexandre Julliard
julliard at winehq.org
Tue Apr 5 15:33:43 CDT 2022
Module: tools
Branch: master
Commit: b5cfda0874e819f1565da2daaac621f21f16767b
URL: https://source.winehq.org/git/tools.git/?a=commit;h=b5cfda0874e819f1565da2daaac621f21f16767b
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Tue Apr 5 14:21:03 2022 +0200
testbot: Use MakeOfficialURL() in non-CGI scripts.
Non-CGI scripts should not have $HTTP_HOST anyway so this is the same as
MakeSecureURL().
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
testbot/bin/WineRunBuild.pl | 2 +-
testbot/bin/WineRunReconfig.pl | 8 ++++----
testbot/bin/WineRunTask.pl | 4 ++--
testbot/bin/WineRunWineTest.pl | 4 ++--
testbot/bin/WineSendLog.pl | 4 ++--
testbot/lib/WineTestBot/Users.pm | 8 ++++----
6 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl
index 1bddc04..7e8fced 100755
--- a/testbot/bin/WineRunBuild.pl
+++ b/testbot/bin/WineRunBuild.pl
@@ -334,7 +334,7 @@ if (!$Domain->IsPoweredOn())
NotifyAdministrator("Putting the ". $VM->Name ." VM offline",
"The ". $VM->Name ." VM should have been powered on to run the task\n".
"below but its state was ". $Domain->GetStateDescription() ." instead.\n".
- MakeSecureURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n\n".
+ MakeOfficialURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n\n".
"So the VM has been put offline and the TestBot will try to regain\n".
"access to it.");
WrapUpAndExit('queued', undef, undef, 'boterror vm off');
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index 9f71ff4..5b6d7df 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -336,7 +336,7 @@ if (!$Domain->IsPoweredOn())
NotifyAdministrator("Putting the ". $VM->Name ." VM offline",
"The ". $VM->Name ." VM should have been powered on to run the task\n".
"below but its state was ". $Domain->GetStateDescription() ." instead.\n".
- MakeSecureURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n\n".
+ MakeOfficialURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n\n".
"So the VM has been put offline and the TestBot will try to regain\n".
"access to it.");
WrapUpAndExit('queued', undef, undef, 'boterror vm off');
@@ -432,7 +432,7 @@ if ($TA->GetFile("Reconfig.log", "$TaskDir/task.log"))
NotifyAdministrator("The ". $VM->Name ." build failed",
"The ". $VM->Name ." build failed and $Status\n\n".
"See the link below for more details:\n".
- MakeSecureURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n");
+ MakeOfficialURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n");
$NewStatus = "badbuild";
}
my $LogErrMsg = CreateLogErrorsCache($LogInfo);
@@ -546,7 +546,7 @@ if ($NewStatus eq 'completed')
"Could not recreate the $IdleSnapshot snapshot:\n\n".
"$ErrMessage\n\n".
"See the link below for more details:\n".
- MakeSecureURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n");
+ MakeOfficialURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n");
FatalError("Could not recreate the $IdleSnapshot snapshot: $ErrMessage\n");
}
@@ -562,7 +562,7 @@ if ($NewStatus eq 'completed')
." after its update:\n\n".
"$ErrMessage\n\n".
"See the link below for more details:\n".
- MakeSecureURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n");
+ MakeOfficialURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n");
}
else
{
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 017e8c4..0641bb5 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -386,7 +386,7 @@ if (!$Domain->IsPoweredOn())
NotifyAdministrator("Putting the ". $VM->Name ." VM offline",
"The ". $VM->Name ." VM should have been powered on to run the task\n".
"below but its state was ". $Domain->GetStateDescription() ." instead.\n".
- MakeSecureURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n\n".
+ MakeOfficialURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n\n".
"So the VM has been put offline and the TestBot will try to regain\n".
"access to it.");
WrapUpAndExit('queued', undef, undef, undef, 'boterror vm off');
@@ -466,7 +466,7 @@ elsif ($Step->Type eq "suite")
if (defined($WebHostName))
{
my $URL = GetTaskURL($JobId, $StepNo, $TaskNo, 1);
- $Script .= "-u ". BatchQuote(MakeSecureURL($URL)) ." ";
+ $Script .= "-u ". BatchQuote(MakeOfficialURL($URL)) ." ";
}
my $Tag = $VM->Type ne "win64" ? "" : $Step->FileType eq "exe64" ? "64" : "32";
$Tag = BuildTag($VM->Name, $Tag);
diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl
index 3526719..62a7fc5 100755
--- a/testbot/bin/WineRunWineTest.pl
+++ b/testbot/bin/WineRunWineTest.pl
@@ -383,7 +383,7 @@ if (!$Domain->IsPoweredOn())
NotifyAdministrator("Putting the ". $VM->Name ." VM offline",
"The ". $VM->Name ." VM should have been powered on to run the task\n".
"below but its state was ". $Domain->GetStateDescription() ." instead.\n".
- MakeSecureURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n\n".
+ MakeOfficialURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n\n".
"So the VM has been put offline and the TestBot will try to regain\n".
"access to it.");
WrapUpAndExit('queued', undef, undef, 'boterror vm off');
@@ -437,7 +437,7 @@ if ($Step->Type eq "suite")
if (defined $WebHostName)
{
my $URL = GetTaskURL($JobId, $StepNo, $TaskNo, 1);
- $Script .= "-u ". ShQuote(MakeSecureURL($URL)) ." ";
+ $Script .= "-u ". ShQuote(MakeOfficialURL($URL)) ." ";
}
my $Info = $VM->Description ? $VM->Description : "";
if ($VM->Details)
diff --git a/testbot/bin/WineSendLog.pl b/testbot/bin/WineSendLog.pl
index 65c95de..954edae 100755
--- a/testbot/bin/WineSendLog.pl
+++ b/testbot/bin/WineSendLog.pl
@@ -48,6 +48,7 @@ use WineTestBot::Jobs;
use WineTestBot::Log;
use WineTestBot::LogUtils;
use WineTestBot::StepsTasks;
+use WineTestBot::Utils;
my $PART_BOUNDARY = "==13F70BD1-BA1B-449A-9CCB-B6A8E90CED47==";
@@ -184,8 +185,7 @@ sub SendLog($)
my $StepsTasks = CreateStepsTasks(undef, $Job);
my @SortedKeys = sort { $a <=> $b } @{$StepsTasks->GetKeys()};
- my $JobURL = ($UseSSL ? "https://" : "http://") .
- "$WebHostName/JobDetails.pl?Key=". $Job->GetKey();
+ my $JobURL = MakeOfficialURL("/JobDetails.pl?Key=". $Job->GetKey());
#
diff --git a/testbot/lib/WineTestBot/Users.pm b/testbot/lib/WineTestBot/Users.pm
index 772a2b7..bd9cf35 100644
--- a/testbot/lib/WineTestBot/Users.pm
+++ b/testbot/lib/WineTestBot/Users.pm
@@ -138,8 +138,8 @@ sub Approve($)
return $ErrMessage;
}
- my $URL = MakeSecureURL("/ResetPassword.pl?Name=" . uri_escape($self->Name) .
- "&ResetCode=" . uri_escape($self->ResetCode));
+ my $URL = MakeOfficialURL("/ResetPassword.pl?Name=". uri_escape($self->Name)
+ ."&ResetCode=". uri_escape($self->ResetCode));
my $Recipient = $self->GetEMailRecipient();
open (SENDMAIL, "|/usr/sbin/sendmail -oi -t -odq");
print SENDMAIL <<"EOF";
@@ -177,8 +177,8 @@ sub SendResetCode($)
return $ErrMessage;
}
- my $URL = MakeSecureURL("/ResetPassword.pl?Name=" . uri_escape($self->Name) .
- "&ResetCode=" . uri_escape($self->ResetCode));
+ my $URL = MakeOfficialURL("/ResetPassword.pl?Name=". uri_escape($self->Name)
+ ."&ResetCode=". uri_escape($self->ResetCode));
my $UserName = $self->Name;
my $Recipient = $self->GetEMailRecipient();
open (SENDMAIL, "|/usr/sbin/sendmail -oi -t -odq");
More information about the wine-cvs
mailing list