  		$compare_runpath = fetch_executable($workdirpath, $row['compare'], $row['compare_md5sum']);
  		$run_runpath = fetch_executable($workdirpath, $row['run'], $row['run_md5sum']);
 diff --git a/judge/runguard.c b/judge/runguard.c
-index 2d613ab..527a2f1 100644
+index 4592da7..364a659 100644
 --- a/judge/runguard.c
 +++ b/judge/runguard.c
-@@ -621,15 +621,18 @@ void read_optarg_time(const char *desc, double *times)
+@@ -169,6 +169,7 @@ struct timeval starttime, endtime;
+ struct tms startticks, endticks;
+ 
+ struct option const long_opts[] = {
++	{"audoscore_path",       required_argument, NULL,         'A'},
+ 	{"root",       required_argument, NULL,         'r'},
+ 	{"user",       required_argument, NULL,         'u'},
+ 	{"group",      required_argument, NULL,         'g'},
+@@ -623,15 +624,18 @@ void read_optarg_time(const char *desc, double *times)
  void setrestrictions()
  {
  	char *path;

 	if ( $verb == 'POST' ) {
 		curl_setopt($ch, CURLOPT_POST, TRUE);
 		if ( is_array($data) ) {
@@ -87,8 +88,8 @@ function request($url, $verb = 'GET', $data = '', $failonerror = true) {
 /**
  * Retrieve a value from the configuration through the REST API.
  */

From e148c49b10bde1bf36f3c947d90f77ad2ebead7f Mon Sep 17 00:00:00 2001
From: Tobias Werth <werth@cs.fau.de>
Date: Wed, 8 Oct 2014 13:36:45 +0200
Subject: [PATCH 1/1] Patch to make AuDoscore work with DOMjudge.

---
 judge/compile.sh           |    3 ++-
 judge/judgedaemon.main.php |   20 +++++++++++---------
 judge/runguard.c           |    9 ++++++++-
 3 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/judge/compile.sh b/judge/compile.sh
index 42f739c..44c8abf 100755
--- a/judge/compile.sh
+++ b/judge/compile.sh
@@ -125,7 +125,8 @@ logmsg $LOG_INFO "starting compile"
 # the compiler writing to different filenames and deleting intermediate files.
 exitcode=0
 $GAINROOT $RUNGUARD ${DEBUG:+-v} $CPUSET_OPT -u "$RUNUSER" -m $SCRIPTMEMLIMIT \
-	-t $SCRIPTTIMELIMIT -c -f $SCRIPTFILELIMIT -s $SCRIPTFILELIMIT -M "$WORKDIR/compile.meta" -- \
+	-t $SCRIPTTIMELIMIT -c -f $SCRIPTFILELIMIT -s $SCRIPTFILELIMIT -M "$WORKDIR/compile.meta" \
+	-A $AUDOSCORE_PATH -- \
 	"$COMPILE_SCRIPT" program "$MEMLIMIT" "$@" >"$WORKDIR/compile.tmp" 2>&1 || \
 	exitcode=$?
 
diff --git a/judge/judgedaemon.main.php b/judge/judgedaemon.main.php
index 716bcc5..2e2dc8e 100644
--- a/judge/judgedaemon.main.php
+++ b/judge/judgedaemon.main.php
@@ -55,6 +55,7 @@ function request($url, $verb = 'GET', $data = '', $failonerror = true) {
