From 4afea8b1871b769983e263865c827b80669bd5b5 Mon Sep 17 00:00:00 2001 From: HonigBij Date: Tue, 25 Aug 2015 13:12:26 +0200 Subject: [PATCH] Support of multiple symlink levels in command_cd --- cowrie/commands/fs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cowrie/commands/fs.py b/cowrie/commands/fs.py index a897031d..62926f8d 100644 --- a/cowrie/commands/fs.py +++ b/cowrie/commands/fs.py @@ -58,7 +58,8 @@ class command_cd(HoneyPotCommand): newpath = f[A_TARGET] count += 1 if count > 10: - raise self.fs.TooManyLevels + self.writeln('bash: cd: %s: Too many levels of symbolic links' % path) + return if not self.fs.is_dir(newpath): self.writeln('bash: cd: %s: Not a directory' % path) return