diff --git a/kippo/commands/fs.py b/kippo/commands/fs.py index 62ecbbc..fcdd675 100644 --- a/kippo/commands/fs.py +++ b/kippo/commands/fs.py @@ -32,7 +32,7 @@ class command_cd(HoneyPotCommand): try: newpath = self.fs.resolve_path(path, self.honeypot.cwd) newdir = self.fs.get_path(newpath) - except IndexError: + except: newdir = None if path == "-": self.writeln('bash: cd: OLDPWD not set') diff --git a/kippo/core/fs.py b/kippo/core/fs.py index 060db1f..0dc9c59 100644 --- a/kippo/core/fs.py +++ b/kippo/core/fs.py @@ -97,7 +97,7 @@ class HoneyPotFilesystem(object): ok = True break if not ok: - return None + raise FileNotFound return cwd[A_CONTENTS] def exists(self, path): @@ -182,7 +182,10 @@ class HoneyPotFilesystem(object): def is_dir(self, path): if path == '/': return True - dir = self.get_path(os.path.dirname(path)) + try: + dir = self.get_path(os.path.dirname(path)) + except: + dir = None if dir is None: return False l = [x for x in dir