prevent duplicate files

git-svn-id: https://kippo.googlecode.com/svn/trunk@13 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
desaster 2009-11-16 17:55:24 +00:00
parent 285fbb21ab
commit 90172c1d2b
1 changed files with 4 additions and 0 deletions

View File

@ -30,6 +30,10 @@ class command_tar(HoneyPotCommand):
'XxX Anal Thunder 5 XxX.AVI',
):
size = 1000000 + int(random.random() * 4000000)
if f in [x[A_NAME] for x in cwd]:
cwd.remove([x for x in cwd if x[A_NAME] == f][0])
cwd.append((
f, T_FILE, 0, 0, size, 33188, time.time(), [], None))
self.honeypot.writeln('./%s' % f)