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
This commit is contained in:
desaster
2010-06-18 18:21:35 +00:00
parent 5158a41fea
commit dbc3e1b13a

View File

@@ -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: