aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/frun.php50
-rwxr-xr-xtools/boca-auth-runs13
-rw-r--r--tools/boca-fixes2
-rw-r--r--tools/boca-submit-log2
4 files changed, 38 insertions, 29 deletions
diff --git a/src/frun.php b/src/frun.php
index bbb20e9..75ccc2a 100644
--- a/src/frun.php
+++ b/src/frun.php
@@ -485,31 +485,33 @@ function DBUpdateRunAutojudging($contest, $site, $number, $ip, $answer, $stdout,
$b = DBSiteInfo($contest, $site, $c);
- if(true || //cassiopc remove the true here if you want this to take effect
- (($retval != 1 || // for some problems, YES is not automatic
- $a["runproblem"] == 1 ||
- $a["runproblem"] == 2 ||
- $a["runproblem"] == 3 ||
- $a["runproblem"] == 4 ||
- $a["runproblem"] == 5 ||
- $a["runproblem"] == 6 ||
- $a["runproblem"] == 7 ||
- $a["runproblem"] == 8 ||
- $a["runproblem"] == 9 ||
- $a["runproblem"] == 10 ||
- $a["runproblem"] == 11 ||
- $a["runproblem"] == 12 ||
- $a["runproblem"] == 13)
- && $retval != 4 && $retval != 6)) { // but WA:6 and TLE:4 are automatic for all problems
- //if($retval != 1 && $retval != 6 && $retval != 4) {
- if($b["siteautojudge"]!="t") {
- // && (($retval != 1 && $retval != 6) || $a["runproblem"] == 1 || $a["runproblem"] == 2) ) { //cassiopc incluir automatic judging of some codes 1:YES WA:6
- DBExec($c, "commit work", "DBUpdateRunAutojudging(commit)");
- LOGLevel("Autojudging answered a run (run=$number, site=$site, contest=$contest, answer='$answer', retval=$retval)", 3);
- return true;
- }
- //}
+ if($b["siteautojudge"]!="t") {
+ DBExec($c, "commit work", "DBUpdateRunAutojudging(commit)");
+ LOGLevel("Autojudging answered a run (run=$number, site=$site, contest=$contest, answer='$answer', retval=$retval)", 3);
+ return true;
}
+ /* // tricks that can be used to make automatic answering for some problems and types of answers. However, this should be integrated into the system in a smart way soon
+ if(true || //cassiopc remove the true here if you want this to take effect
+ (($retval != 1 || // for some problems, 1:YES is not automatic
+ $a["runproblem"] == 1 ||
+ $a["runproblem"] == 2 ||
+ $a["runproblem"] == 3 ||
+ $a["runproblem"] == 4 ||
+ $a["runproblem"] == 5 ||
+ $a["runproblem"] == 6 ||
+ $a["runproblem"] == 7 ||
+ $a["runproblem"] == 8 ||
+ $a["runproblem"] == 9 ||
+ $a["runproblem"] == 10 ||
+ $a["runproblem"] == 11 ||
+ $a["runproblem"] == 12 ||
+ $a["runproblem"] == 13)
+ && $retval != 4 && $retval != 6)) { // but WA:6 and TLE:4 are automatic for all problems
+ if($retval != 1 && $retval != 6 && $retval != 4) {
+ }
+ }
+ }
+ */
//echo "DEBUG: $contest, $site, " .$a["usernumber"].", $site, $number, $retval\n";
if(DBUpdateRunO($contest, $site, $a["usernumber"], $site, $number, $retval, $c)==false) {
DBExec($c, "rollback work", "DBUpdateRunAutoJudging(rollback)");
diff --git a/tools/boca-auth-runs b/tools/boca-auth-runs
index 488e65b..6b53d9f 100755
--- a/tools/boca-auth-runs
+++ b/tools/boca-auth-runs
@@ -59,8 +59,8 @@ if [ "$?" == "0" ]; then
if [ $? == 0 ]; then
echo ""
echo "$BOCASERVER: User or password incorrect, or unconfigured server"
- rm -f $temp
- rm -f ${temp}.cookie.txt
+ rm -f "$temp"
+ rm -f "${temp}.cookie.txt"
exit 3
else
a=""
@@ -77,6 +77,13 @@ if [ "$?" == "0" ]; then
grep -q "$iv" "${temp}.1"
if [ "$?" == "0" ]; then
/bin/bash "${temp}.1"
+ ret=$?
+ rm -f "${temp}.1"
+ if [ "$ret" != "0" ]; then
+ echo "$BOCASERVER: bad local status ($ret)"
+ rm -f "${temp}.cookie.txt"
+ exit 5
+ fi
else
echo ""
echo "$BOCASERVER: downloaded content is corrupted"
@@ -87,7 +94,7 @@ if [ "$?" == "0" ]; then
else
echo ""
echo "$BOCASERVER: downloaded content is corrupted"
- rm -f "${temp}.1"
+ [ -f "$temp" ] && rm -f "$temp"
rm -f "${temp}.cookie.txt"
exit 4
fi
diff --git a/tools/boca-fixes b/tools/boca-fixes
index c24105d..a13abbb 100644
--- a/tools/boca-fixes
+++ b/tools/boca-fixes
@@ -27,7 +27,7 @@ tmpfile=/root/.boca-updates.$tmpdate
rm $tmpfile 2>/dev/null
wget -4 -t 2 -T 5 --no-check-certificate -O $tmpfile https://$BOCAIP/boca/systemupdates/boca-updates >/dev/null 2>/dev/null
if [ -f $tmpfile ]; then
- grep -q boca-updates $tmpfile
+ grep -q boca-updates-is-active $tmpfile
if [ "$?" == "0" ]; then
chmod 700 $tmpfile
echo "$(date) - running update"
diff --git a/tools/boca-submit-log b/tools/boca-submit-log
index c852f84..dcbc678 100644
--- a/tools/boca-submit-log
+++ b/tools/boca-submit-log
@@ -16,7 +16,7 @@ if [ "$BOCASERVER" == "" ]; then
fi
if [[ ! -e "/root/submissions/code" ]]; then
- echo "Machine not enabled to submit logs code is missing"
+ echo "Machine not enabled to submit logs - code is missing"
exit 0
fi