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() {
52
52
// create the execution script
53
53
BufferedWriter out = new BufferedWriter (new OutputStreamWriter (new FileOutputStream (dir + "/run.sh" )));
54
54
out .write ("cd \" " + dir +"\" \n " );
55
+ out .write ("chroot .\n " );
55
56
out .write ("./a.out < in.txt > out.txt" );
56
57
out .close ();
57
58
Runtime r = Runtime .getRuntime ();
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ public void execute() {
52
52
// create the execution script
53
53
BufferedWriter out = new BufferedWriter (new OutputStreamWriter (new FileOutputStream (dir + "/run.sh" )));
54
54
out .write ("cd \" " + dir +"\" \n " );
55
+ out .write ("chroot .\n " );
55
56
out .write ("./a.out < in.txt > out.txt" );
56
57
out .close ();
57
58
Runtime r = Runtime .getRuntime ();
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ public void execute() {
52
52
// create the execution script
53
53
BufferedWriter out = new BufferedWriter (new OutputStreamWriter (new FileOutputStream (dir + "/run.sh" )));
54
54
out .write ("cd \" " + dir +"\" \n " );
55
+ out .write ("chroot .\n " );
55
56
out .write ("java " + file .substring (0 , file .length () - 5 ) + " < in.txt > out.txt" );
56
57
out .close ();
57
58
Runtime r = Runtime .getRuntime ();
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ public void compile() {
32
32
// create the execution script
33
33
out = new BufferedWriter (new OutputStreamWriter (new FileOutputStream (dir + "/run.sh" )));
34
34
out .write ("cd \" " + dir +"\" \n " );
35
+ out .write ("chroot .\n " );
35
36
out .write ("python " + file + "< in.txt > out.txt 2>err.txt" );
36
37
out .close ();
37
38
Runtime r = Runtime .getRuntime ();
You can’t perform that action at this time.
0 commit comments