This repository was archived by the owner on Mar 28, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +4
-0
lines changed
codejudge-compiler/src/codejudge/compiler/languages Expand file tree Collapse file tree 4 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ public void execute() {
5252 // create the execution script
5353 BufferedWriter out = new BufferedWriter (new OutputStreamWriter (new FileOutputStream (dir + "/run.sh" )));
5454 out .write ("cd \" " + dir +"\" \n " );
55+ out .write ("chroot .\n " );
5556 out .write ("./a.out < in.txt > out.txt" );
5657 out .close ();
5758 Runtime r = Runtime .getRuntime ();
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ public void execute() {
5252 // create the execution script
5353 BufferedWriter out = new BufferedWriter (new OutputStreamWriter (new FileOutputStream (dir + "/run.sh" )));
5454 out .write ("cd \" " + dir +"\" \n " );
55+ out .write ("chroot .\n " );
5556 out .write ("./a.out < in.txt > out.txt" );
5657 out .close ();
5758 Runtime r = Runtime .getRuntime ();
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ public void execute() {
5252 // create the execution script
5353 BufferedWriter out = new BufferedWriter (new OutputStreamWriter (new FileOutputStream (dir + "/run.sh" )));
5454 out .write ("cd \" " + dir +"\" \n " );
55+ out .write ("chroot .\n " );
5556 out .write ("java " + file .substring (0 , file .length () - 5 ) + " < in.txt > out.txt" );
5657 out .close ();
5758 Runtime r = Runtime .getRuntime ();
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ public void compile() {
3232 // create the execution script
3333 out = new BufferedWriter (new OutputStreamWriter (new FileOutputStream (dir + "/run.sh" )));
3434 out .write ("cd \" " + dir +"\" \n " );
35+ out .write ("chroot .\n " );
3536 out .write ("python " + file + "< in.txt > out.txt 2>err.txt" );
3637 out .close ();
3738 Runtime r = Runtime .getRuntime ();
You can’t perform that action at this time.
0 commit comments