From d95a85401bb0a5a89a706d99677f81a6e33a2187 Mon Sep 17 00:00:00 2001 From: desaster Date: Fri, 18 Jun 2010 18:29:02 +0000 Subject: [PATCH] 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 --- kippo/commands/base.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kippo/commands/base.py b/kippo/commands/base.py index 342817e..c8319fc 100644 --- a/kippo/commands/base.py +++ b/kippo/commands/base.py @@ -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