mirror of https://github.com/cowrie/cowrie.git
when using execCommand, ls breaks without windowSize
This commit is contained in:
parent
4e8ad9c92c
commit
9bd02f780c
|
@ -58,7 +58,13 @@ class command_ls(HoneyPotCommand):
|
|||
return
|
||||
count = 0
|
||||
maxlen = max([len(x) for x in l])
|
||||
perline = int(self.honeypot.user.windowSize[1] / (maxlen + 1))
|
||||
|
||||
try:
|
||||
wincols = self.honeypot.user.windowSize[1]
|
||||
except AttributeError:
|
||||
wincols = 80
|
||||
|
||||
perline = int(wincols / (maxlen + 1))
|
||||
for f in l:
|
||||
if count == perline:
|
||||
count = 0
|
||||
|
|
Loading…
Reference in New Issue