mirror of https://github.com/cowrie/cowrie.git
ls -a should at least display '. ..'
git-svn-id: https://kippo.googlecode.com/svn/trunk@198 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
parent
4fde1e5c52
commit
dbf8e84d88
|
@ -49,18 +49,16 @@ class command_ls(HoneyPotCommand):
|
|||
self.honeypot.writeln(
|
||||
'ls: cannot access %s: No such file or directory' % path)
|
||||
return
|
||||
if not len(files):
|
||||
return
|
||||
l = [x[A_NAME] for x in files \
|
||||
if self.show_hidden or not x[A_NAME].startswith('.')]
|
||||
if self.show_hidden:
|
||||
l.insert(0, '..')
|
||||
l.insert(0, '.')
|
||||
if not l:
|
||||
return
|
||||
count = 0
|
||||
maxlen = max([len(x) for x in l])
|
||||
perline = int(self.honeypot.user.windowSize[1] / (maxlen + 1))
|
||||
if self.show_hidden:
|
||||
l.insert(0, '..')
|
||||
l.insert(0, '.')
|
||||
for f in l:
|
||||
if count == perline:
|
||||
count = 0
|
||||
|
|
Loading…
Reference in New Issue