Hey, We are trying to integrate selenium with domjudge. Could you please help in figuring out the ways we can provide network access in chroot environment. We are trying to run the code below via domjudge. And domjudge is returning the following exception: java.net.UnknownHostException: www.google.com. Could you let us known if there is a work around.
code:
import java.net.*; import java.io.*;
public class Solution { public static void main(String[] args) throws Exception {
URL str = new URL("http://www.google.com/"); BufferedReader in = new BufferedReader( new InputStreamReader(str.openStream()));
String inputLine; while ((inputLine = in.readLine()) != null) System.out.println(inputLine); in.close(); } }
Hi,
On Thu, July 19, 2018 11:21, Sarthak Garg wrote:
We are trying to integrate selenium with domjudge. Could you please help in figuring out the ways we can provide network access in chroot environment. We are trying to run the code below via domjudge. And domjudge is returning the following exception: java.net.UnknownHostException: www.google.com.
Yes, this is a feature of DOMjudge. In the normal case, contestant code is not allowed network access so this is explicitly blocked in the runguard.
It's this line specifically: https://github.com/DOMjudge/domjudge/blob/master/judge/runguard.c#L1077
The behaviour is not currently configurable. However if you comment out that line and rebuild runguard I think you should be able to have networking access inside the chroot.
Cheers, Thijs