mirror of
https://github.com/aljazceru/cowrie.git
synced 2025-12-18 06:24:20 +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
|
return
|
||||||
for f in self.args:
|
for f in self.args:
|
||||||
path = self.fs.resolve_path(f, self.honeypot.cwd)
|
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):
|
if self.fs.exists(path):
|
||||||
# FIXME: modify the timestamp here
|
# FIXME: modify the timestamp here
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user