From dbc3e1b13a1b9d6c59d5aff12956ca6d9cfcbe68 Mon Sep 17 00:00:00 2001 From: desaster Date: Fri, 18 Jun 2010 18:21:35 +0000 Subject: [PATCH] Fix issue #14, tar hangs when trying to unpack a file without a directory (by jfbethlehem) git-svn-id: https://kippo.googlecode.com/svn/trunk@135 951d7100-d841-11de-b865-b3884708a8e2 --- kippo/commands/tar.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kippo/commands/tar.py b/kippo/commands/tar.py index 2de7e33..c1e2399 100644 --- a/kippo/commands/tar.py +++ b/kippo/commands/tar.py @@ -57,6 +57,9 @@ class command_tar(HoneyPotCommand): if f.isdir(): self.fs.mkdir(dest, 0, 0, 4096, f.mode, f.mtime) elif f.isfile(): + if not self.fs.exists(os.path.dirname(dest)): + self.fs.mkdir(os.path.dirname(dest), + 0, 0, 4096, f.mode, f.mtime) self.fs.mkfile(dest, 0, 0, f.size, f.mode, f.mtime) self.honeypot.commands[dest] = random.choice(dice.clist) else: