  	$res = dj_json_decode($res);
  	return $res[$name];
  }
-@@ -336,12 +337,13 @@ function judge($row)
+@@ -338,12 +339,13 @@ function judge($row)
  
  	// Set configuration variables for called programs
  	putenv('USE_CHROOT='        . (USE_CHROOT ? '1' : ''));
--	putenv('COMPILETIME='       . dbconfig_get_rest('compile_time'));
+-	putenv('SCRIPTTIMELIMIT='   . dbconfig_get_rest('script_timelimit'));
+-	putenv('SCRIPTMEMLIMIT='    . dbconfig_get_rest('script_memory_limit'));
+-	putenv('SCRIPTFILELIMIT='   . dbconfig_get_rest('script_filesize'));
 -	putenv('MEMLIMIT='          . dbconfig_get_rest('memory_limit'));
--	putenv('COMPILEMEMLIMIT='   . dbconfig_get_rest('compile_memory'));
--	putenv('COMPILEFILELIMIT='  . dbconfig_get_rest('compile_filesize'));
 -	putenv('FILELIMIT='         . dbconfig_get_rest('filesize_limit'));
 -	putenv('PROCLIMIT='         . dbconfig_get_rest('process_limit'));
-+	putenv('COMPILETIME='       . dbconfig_get_rest('compile_time', $row['judgingid']));
++	putenv('SCRIPTTIMELIMIT='   . dbconfig_get_rest('script_timelimit', $row['judgingid']));
++	putenv('SCRIPTMEMLIMIT='    . dbconfig_get_rest('script_memory_limit', $row['judgingid']));
++	putenv('SCRIPTFILELIMIT='   . dbconfig_get_rest('script_filesize', $row['judgingid']));
 +	putenv('MEMLIMIT='          . dbconfig_get_rest('memory_limit', $row['judgingid']));
-+	putenv('COMPILEMEMLIMIT='   . dbconfig_get_rest('compile_memory', $row['judgingid']));
-+	putenv('COMPILEFILELIMIT='  . dbconfig_get_rest('compile_filesize', $row['judgingid']));
 +	putenv('FILELIMIT='         . dbconfig_get_rest('filesize_limit', $row['judgingid']));
 +	putenv('PROCLIMIT='         . dbconfig_get_rest('process_limit', $row['judgingid']));
 +	putenv('AUDOSCORE_PATH='    . dbconfig_get_rest('audoscore_path', $row['judgingid']));
  
  	$cpuset_opt = "";
  	if ( isset($options['daemonid']) ) $cpuset_opt = "-n ${options['daemonid']}";
-@@ -480,7 +482,7 @@ function judge($row)
+@@ -484,7 +486,7 @@ function judge($row)
  		// do the actual test-run
  		$hardtimelimit = $row['maxruntime'] +
  		                 overshoot_time($row['maxruntime'],

From 34638dc565a44f225de7009105f23d20929b1a8f Mon Sep 17 00:00:00 2001
From: Robert Obermeier <obbi@u5b.de>
Date: Sun, 3 Aug 2014 21:03:59 +0000
Subject: [PATCH] AuDoScore changeset

---
 judge/judgedaemon.main.php |   20 +++++++++++---------
 judge/runguard.c           |    3 +++
 lib/www/auth.php           |    2 +-
 3 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/judge/judgedaemon.main.php b/judge/judgedaemon.main.php
index 566faa0..9236cae 100644
--- a/judge/judgedaemon.main.php
+++ b/judge/judgedaemon.main.php
@@ -55,6 +55,7 @@ function request($url, $verb = 'GET', $data = '', $failonerror = true) {

 
 	/* Set resource limits: must be root to raise hard limits.
 	   Note that limits can thus be raised from the systems defaults! */
@@ -794,10 +798,13 @@ int main(int argc, char **argv)
 	be_verbose = be_quiet = 0;
 	show_help = show_version = 0;
 	opterr = 0;
-	while ( (opt = getopt_long(argc,argv,"+r:u:g:t:C:m:f:p:P:co:e:s:M:vq",long_opts,(int *) 0))!=-1 ) {
+	while ( (opt = getopt_long(argc,argv,"+r:u:g:t:C:m:f:p:P:co:e:s:M:A:vq",long_opts,(int *) 0))!=-1 ) {
 		switch ( opt ) {
 		case 0:   /* long-only option */
 			break;
+		case 'A': /* AuDoscore path option */
+			setenv("AUDOSCORE_PATH", optarg, 1);
+			break;
 		case 'r': /* rootdir option */
 			use_root = 1;
 			rootdir = (char *) malloc(strlen(optarg)+2);
-- 
1.7.9.5

