mirror of
https://github.com/aljazceru/cowrie.git
synced 2025-12-17 22:14:19 +01:00
Fix #15, touch crashes when trying to touch unreachable files
(by jfbethlehem) git-svn-id: https://kippo.googlecode.com/svn/trunk@136 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
@@ -294,6 +294,11 @@ class command_touch(HoneyPotCommand):
|
||||
return
|
||||
for f in self.args:
|
||||
path = self.fs.resolve_path(f, self.honeypot.cwd)
|
||||
if not self.fs.exists(os.path.dirname(path)):
|
||||
self.writeln(
|
||||
'touch: cannot touch `%s`: no such file or directory' % \
|
||||
(path))
|
||||
return
|
||||
if self.fs.exists(path):
|
||||
# FIXME: modify the timestamp here
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user