From 1ba4f341f6af7058bef2cbb4446c3ced1bbf6ecf Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Thu, 8 Oct 2009 10:31:28 -0600 Subject: [PATCH] Fix exception in flagd.py:FlagServer.handle_close --- ctf/flagd.py | 2 ++ pwnables/Makefile | 2 +- pwnables/skel/usr/lib/www/flag | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 120000 pwnables/skel/usr/lib/www/flag diff --git a/ctf/flagd.py b/ctf/flagd.py index 6ae444b..f827972 100755 --- a/ctf/flagd.py +++ b/ctf/flagd.py @@ -142,6 +142,8 @@ class FlagServer(asynchat.async_chat): self.inbuf.append(data) def set_flag(self, team): + if not self.cat: + return self.flag = team self.submitter.set_flag(self.cat, team) f = open(os.path.join(flags_dir, self.cat), 'w') diff --git a/pwnables/Makefile b/pwnables/Makefile index 7eca8ef..5327560 100644 --- a/pwnables/Makefile +++ b/pwnables/Makefile @@ -18,4 +18,4 @@ target: $(MAKE) -C daemons TARGET=$(TARGET) install clean: - rm -rf target + rm -rf target pwnables.tce diff --git a/pwnables/skel/usr/lib/www/flag b/pwnables/skel/usr/lib/www/flag new file mode 120000 index 0000000..f4bdb9f --- /dev/null +++ b/pwnables/skel/usr/lib/www/flag @@ -0,0 +1 @@ +/var/lib/cat/flag \ No newline at end of file