summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/mock_entrance_exam
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge/tasks/mock_entrance_exam')
-rw-r--r--kpov_judge/tasks/mock_entrance_exam/task.py35
1 files changed, 30 insertions, 5 deletions
diff --git a/kpov_judge/tasks/mock_entrance_exam/task.py b/kpov_judge/tasks/mock_entrance_exam/task.py
index b0c053d..017ad54 100644
--- a/kpov_judge/tasks/mock_entrance_exam/task.py
+++ b/kpov_judge/tasks/mock_entrance_exam/task.py
@@ -28,7 +28,25 @@ Napišite skripto ali program {P_script} v domačem imeniku uporabnika student,
Lastnik vseh ustvarjenih datotek mora biti uporabnik student.
Gesla uporabnika student (vaje) ne smete spreminjati.''',
- 'en': u'''
+ 'en': u'''Set up two virtual machines - SimpleArbiter and Student.
+Both should be connected to the Internet. Student should also be accessible
+from SimpleArbiter at the address {student_IP}.
+
+Keep in mind that a program called {net_prog_name} starts on Student
+whenever Student boots. This program may change your network settings.
+
+There is a program called {P_c} in the home directory of student. Compile it
+into a program called {P_executable}. The source code is intentionally broken
+so that unneccessarry characters are inserted into the file. You have to fix
+the file before compiling.
+
+Also, write a script or program called {P_script} in the home directory of student.
+The script should:
+- run {P_executable} with the argument {arg_c} and pipe the value of the environment variable {env_c} into {P_executable}'s standard input.
+- redirect stderr of {P_executable} into a file called {out_stderr_c}.
+- save each line which {P_executable} outputs and which contains the character sequence "ma" into {out_stdout_c}.
+
+The owner of all created files should be student. You are not allowed to change student's password (vaje).
''',
}
@@ -51,18 +69,21 @@ computers = {
{'name': 'student-entrance'}
],
'flavor': 'm1.tiny',
- 'network_interfaces': [{'network': 'net1'}],
+ 'network_interfaces': [{'network': 'net1'}, {'network': 'net3'}],
'config_drive': True,
}
}
networks = {
'net1': {
- 'public': True,
+ 'public': False,
},
'net2': {
- 'public': False,
+ 'public': True,
},
+ 'net3': {
+ 'public': True,
+ }
}
params_meta = {
@@ -264,10 +285,14 @@ int main(int argc, char **argv){
}
'''
evil_shell_source = """#!/bin/bash -e
-{ while true; do
+{ while true; do
ifconfig eth1 10.0.4.19 2> /dev/null;
ifconfig eth0 10.0.4.20 2> /dev/null;
ifconfig eth2 10.0.4.21 2> /dev/null;
+ ifconfig en0p3 10.0.4.19 2> /dev/null;
+ ifconfig en0p8 10.0.4.20 2> /dev/null;
+ ifconfig enp0p3 10.0.4.21 2> /dev/null;
+ ifconfig enp0p8 10.0.4.21 2> /dev/null;
sleep 10;
done; }&
"""