summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kpov_judge/tasks/mock_entrance_exam/task.py35
-rw-r--r--kpov_judge/tasks/set_motd/task.py8
2 files changed, 34 insertions, 9 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; }&
"""
diff --git a/kpov_judge/tasks/set_motd/task.py b/kpov_judge/tasks/set_motd/task.py
index ecc600b..0e862a6 100644
--- a/kpov_judge/tasks/set_motd/task.py
+++ b/kpov_judge/tasks/set_motd/task.py
@@ -68,10 +68,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'peer_ip': {'descriptions': {'si': u'IP računalnika'}, 'w': True, 'public':True, 'type': 'IP', 'generated': False},
- 'peer_user': {'descriptions': {'si': 'ime uporabnika'}, 'w': False, 'public': True, 'type': 'username', 'generated': True},
- 'peer_passwd': {'descriptions': {'si': 'geslo uporabnika'}, 'w': True, 'public': True, 'type': 'alnumstr', 'generated': False},
- 'niz': {'descriptions':{'si': u'niz, ki naj se v motd pokaže'}, 'w': False, 'public': True, 'type': 'short_text', 'generated': True},
+ 'peer_ip': {'descriptions': {'si': u'IP računalnika', 'en':'IP'}, 'w': True, 'public':True, 'type': 'IP', 'generated': False},
+ 'peer_user': {'descriptions': {'si': 'ime uporabnika', 'en':'Username'}, 'w': False, 'public': True, 'type': 'username', 'generated': True},
+ 'peer_passwd': {'descriptions': {'si': 'geslo uporabnika', 'en': 'Password'}, 'w': True, 'public': True, 'type': 'alnumstr', 'generated': False},
+ 'niz': {'descriptions':{'si': u'niz, ki naj se v motd pokaže', 'en': 'The string which should be displayed in the MOTD'}, 'w': False, 'public': True, 'type': 'short_text', 'generated': True},
}
def task(peer_ip, peer_user, peer_passwd, niz):