mirror of
https://github.com/aljazceru/cowrie.git
synced 2026-01-21 23:24:34 +01:00
more fixes for correct behavior with non-existent files
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user