diff --git a/ctf/config.py b/ctf/config.py
index e39eacc..1bdbe96 100755
--- a/ctf/config.py
+++ b/ctf/config.py
@@ -96,10 +96,9 @@ def start_html(title, hdr='', cls='', links=[], links_title=None):
diff --git a/ctf/puzzler.py b/ctf/puzzler.py
index 8700ef5..5022cc1 100755
--- a/ctf/puzzler.py
+++ b/ctf/puzzler.py
@@ -157,7 +157,7 @@ def main():
# Show available puzzles in category
show_puzzles(cat, cat_dir)
else:
- thekey = get_key(cat, points)
+ thekeys = get_key(cat, points)
if not teams.chkpasswd(team, passwd):
start_html('Wrong password')
end_html()
diff --git a/ctfd.py b/ctfd.py
index 74a0870..3b2a23c 100755
--- a/ctfd.py
+++ b/ctfd.py
@@ -20,7 +20,9 @@ def chart(s):
def reap():
try:
while True:
- os.waitpid(0, os.WNOHANG)
+ pid, ret = os.waitpid(0, os.WNOHANG)
+ if not pid:
+ break
except OSError:
pass
diff --git a/pollster/log.run.pollster b/pollster/log.run.pollster
new file mode 100755
index 0000000..4325add
--- /dev/null
+++ b/pollster/log.run.pollster
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+exec logger -t pollster
diff --git a/pollster/pollster.py b/pollster/pollster.py
index baa3128..0016464 100755
--- a/pollster/pollster.py
+++ b/pollster/pollster.py
@@ -11,9 +11,9 @@ import traceback
from ctf import config
from ctf import pointscli
-DEBUG = False
+DEBUG = False
POLL_INTERVAL = config.get('pollster', 'poll_interval')
-IP_DIR = config.get('pollster', 'heartbeat_dir')
+IP_DIR = config.get('pollster', 'heartbeat_dir')
REPORT_PATH = config.get('pollster', 'results')
SOCK_TIMEOUT = config.get('pollster', 'poll_timeout')
@@ -147,9 +147,9 @@ while True:
t_start = time.time()
# gather the list of IPs to poll
- ips = os.listdir(IP_DIR)
+ ips = os.listdir(IP_DIR)
- out = io.StringIO()
+ out = io.StringIO()
out.write(config.start_html('Team Service Availability'))
for ip in ips:
# check file name format is ip
@@ -199,9 +199,8 @@ while True:
if out is not None:
out.write(config.end_html())
- out.close()
- open(REPORT_PATH, 'w').write(out.getvalue())
+ open(REPORT_PATH, 'w').write(out.getvalue())
# sleep until its time to poll again
time.sleep(sleep_time)