From fcbce3a6dd763ef0aac1e7e46d0f7f2612d3b356 Mon Sep 17 00:00:00 2001 From: desaster Date: Sat, 24 Apr 2010 13:12:31 +0000 Subject: [PATCH] New command: touch git-svn-id: https://kippo.googlecode.com/svn/trunk@107 951d7100-d841-11de-b865-b3884708a8e2 --- kippo/commands/base.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/kippo/commands/base.py b/kippo/commands/base.py index d908f65..2e4dd2e 100644 --- a/kippo/commands/base.py +++ b/kippo/commands/base.py @@ -280,6 +280,20 @@ class command_history(HoneyPotCommand): count += 1 commands['history'] = command_history +class command_touch(HoneyPotCommand): + def call(self): + if not len(self.args): + self.writeln('touch: missing file operand') + self.writeln('Try `touch --help\' for more information.') + return + for f in self.args: + path = self.fs.resolve_path(f, self.honeypot.cwd) + if self.fs.exists(path): + # FIXME: modify the timestamp here + continue + self.fs.mkfile(path, 0, 0, 0, 33188) +commands['/bin/touch'] = command_touch + class command_nop(HoneyPotCommand): def call(self): pass