diff --git a/judge/judgedaemon.main.php b/judge/judgedaemon.main.php index c62539bc9d..676f1f596e 100644 --- a/judge/judgedaemon.main.php +++ b/judge/judgedaemon.main.php @@ -328,6 +328,7 @@ function fetch_executable_internal( $hash ]); global $langexts; + global $myhost; $execdeploypath = $execdir . '/.deployed'; $execbuilddir = $execdir . '/build'; $execbuildpath = $execbuilddir . '/build'; @@ -336,11 +337,11 @@ function fetch_executable_internal( if (!is_dir($execdir) || !file_exists($execdeploypath)) { system('rm -rf ' . dj_escapeshellarg($execdir) . ' ' . dj_escapeshellarg($execbuilddir), $retval); if ($retval !== 0) { - error("Deleting '$execdir' or '$execbuilddir' was unsuccessful."); + disable('judgehost', 'hostname', $myhost, "Deleting '$execdir' or '$execbuilddir' was unsuccessful."); } system('mkdir -p ' . dj_escapeshellarg($execbuilddir), $retval); if ($retval !== 0) { - error("Could not create directory '$execbuilddir'"); + disable('judgehost', 'hostname', $myhost, "Could not create directory '$execbuilddir'"); } logmsg(LOG_INFO, " 💾 Fetching new executable '$type/$execid' with hash '$hash'."); @@ -389,7 +390,7 @@ function fetch_executable_internal( $unescapedSource = ""; foreach ($langexts as $lang => $langext) { if (($handle = opendir($execbuilddir)) === false) { - error("Could not open $execbuilddir"); + disable('judgehost', 'hostname', $myhost, "Could not open $execbuilddir"); } while (($file = readdir($handle)) !== false) { $ext = pathinfo($file, PATHINFO_EXTENSION); @@ -434,7 +435,7 @@ function fetch_executable_internal( break; } if (file_put_contents($execbuildpath, $buildscript) === false) { - error("Could not write file 'build' in $execbuilddir"); + disable('judgehost', 'hostname', $myhost, "Could not write file 'build' in $execbuilddir"); } chmod($execbuildpath, 0755); } @@ -466,10 +467,10 @@ function fetch_executable_internal( # team submission and runjury programs and connects their pipes. $runscript = file_get_contents(LIBJUDGEDIR . '/run-interactive.sh'); if (rename($execrunpath, $execrunjurypath) === false) { - error("Could not move file 'run' to 'runjury' in $execbuilddir"); + disable('judgehost', 'hostname', $myhost, "Could not move file 'run' to 'runjury' in $execbuilddir"); } if (file_put_contents($execrunpath, $runscript) === false) { - error("Could not write file 'run' in $execbuilddir"); + disable('judgehost', 'hostname', $myhost, "Could not write file 'run' in $execbuilddir"); } chmod($execrunpath, 0755); } @@ -841,14 +842,14 @@ function fetch_executable_internal( ); if (isset($error)) { $scriptId = $judgeTask['run_script_id']; - error("Retrieving/storing debug script '$scriptId' failed."); + disable('judgehost', 'hostname', $myhost, "Retrieving/storing debug script '$scriptId' failed."); } $debug_cmd = implode(' ', array_map('dj_escapeshellarg', [$runpath, $workdir, $tmpfile])); system($debug_cmd, $retval); if ($retval !== 0) { - error("Running '$runpath' failed."); + disable('judgehost', 'hostname', $myhost, "Running '$runpath' failed."); } request(