Closed Nageshmal closed 2 days ago
Implement a java wrapper as judge engine. The wrapper should protect system from malicious java programs.
Please can u explain how to implement java wrapper as judge engine .
You can read the code in judge/
So, In /var/www/moodle/local/onlinejudge/judge/sandbox/lib.php (gedit application)
class judge_sandbox extends judge_base {
protected static $supported_languages = array(
'c' => 'gcc -m32 -D_MOODLE_ONLINEJUDGE -Wall -static -o %DEST% %SOURCES% -lm',
'c_warn2err' => 'gcc -m32 -D_MOODLE_ONLINEJUDGE -Wall -Werror -static -o %DEST% %SOURCES% -lm',
'cpp' => 'g++ -m32 -D_MOODLE_ONLINEJUDGE -Wall -static -o %DEST% %SOURCES% -lm',
'cpp_warn2err' => 'g++ -m32 -D_MOODLE_ONLINEJUDGE -Wall -Werror -static -o %DEST% %SOURCES% -lm',
'java' => 'javac -m32 -D_MOODLE_ONLINEJUDGE -Wall -static -o %DEST% %SOURCES% -lm'
);
If u see above array i have included java compiler option... Is this enough to run java programs in sandbox???
When i did that i got a compilation Error as:
Details: javac: invalid flag: -m32
Usage: javac
I actually thought of running java codes locally in sandbox instead of running it in ideone.com . Please suggest me how to do this .