mirror of
https://github.com/aljazceru/cowrie.git
synced 2025-12-17 22:14:19 +01:00
add some duplicate file prevention
git-svn-id: https://kippo.googlecode.com/svn/trunk@12 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
@@ -71,6 +71,10 @@ class command_mkdir(HoneyPotCommand):
|
|||||||
'mkdir: cannot create directory `%s\': ' % f + \
|
'mkdir: cannot create directory `%s\': ' % f + \
|
||||||
'No such file or directory')
|
'No such file or directory')
|
||||||
return
|
return
|
||||||
|
if f in [x[A_NAME] for x in dir]:
|
||||||
|
self.honeypot.writeln(
|
||||||
|
'mkdir: cannot create directory `test\': File exists')
|
||||||
|
return
|
||||||
dir.append([f, T_DIR, 0, 0, 4096, 16877, time.time(), [], None])
|
dir.append([f, T_DIR, 0, 0, 4096, 16877, time.time(), [], None])
|
||||||
|
|
||||||
class command_uptime(HoneyPotCommand):
|
class command_uptime(HoneyPotCommand):
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ Saving to: `%(file)s'
|
|||||||
}
|
}
|
||||||
self.honeypot.writeln(output)
|
self.honeypot.writeln(output)
|
||||||
cwd = self.honeypot.fs.get_path(self.honeypot.cwd)
|
cwd = self.honeypot.fs.get_path(self.honeypot.cwd)
|
||||||
|
if outfile in [x[A_NAME] for x in cwd]:
|
||||||
|
cwd.remove([x for x in cwd if x[A_NAME] == outfile][0])
|
||||||
cwd.append((outfile, T_FILE, 0, 0, size, 33188, time.time(), [], None))
|
cwd.append((outfile, T_FILE, 0, 0, size, 33188, time.time(), [], None))
|
||||||
|
|
||||||
# now just dl the file in background...
|
# now just dl the file in background...
|
||||||
|
|||||||
Reference in New Issue
Block a user