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(
|
self.honeypot.writeln(
|
||||||
'ls: cannot access %s: No such file or directory' % path)
|
'ls: cannot access %s: No such file or directory' % path)
|
||||||
return
|
return
|
||||||
if not len(files):
|
|
||||||
return
|
|
||||||
l = [x[A_NAME] for x in files \
|
l = [x[A_NAME] for x in files \
|
||||||
if self.show_hidden or not x[A_NAME].startswith('.')]
|
if self.show_hidden or not x[A_NAME].startswith('.')]
|
||||||
|
if self.show_hidden:
|
||||||
|
l.insert(0, '..')
|
||||||
|
l.insert(0, '.')
|
||||||
if not l:
|
if not l:
|
||||||
return
|
return
|
||||||
count = 0
|
count = 0
|
||||||
maxlen = max([len(x) for x in l])
|
maxlen = max([len(x) for x in l])
|
||||||
perline = int(self.honeypot.user.windowSize[1] / (maxlen + 1))
|
perline = int(self.honeypot.user.windowSize[1] / (maxlen + 1))
|
||||||
if self.show_hidden:
|
|
||||||
l.insert(0, '..')
|
|
||||||
l.insert(0, '.')
|
|
||||||
for f in l:
|
for f in l:
|
||||||
if count == perline:
|
if count == perline:
|
||||||
count = 0
|
count = 0
|
||||||
|
|
Loading…
Reference in New Issue