python 3 compat test

This commit is contained in:
Michel Oosterhof 2017-07-16 19:43:10 +04:00
parent 838a487a16
commit 3ca7cc1da5
1 changed files with 4 additions and 2 deletions

View File

@ -141,7 +141,8 @@ class HoneyPotCommand(object):
"""
log.msg('QUEUED INPUT: {}'.format(line))
# FIXME: naive command parsing, see lineReceived below
line=line.decode()
if (isinstance(line, str)):
line = line.decode()
self.protocol.cmdstack[0].cmdpending.append(shlex.split(line))
@ -185,7 +186,8 @@ class HoneyPotShell(object):
"""
"""
log.msg(eventid='cowrie.command.input', input=line, format='CMD: %(input)s')
line=line.decode()
if (isinstance(line, str)):
line = line.decode()
self.lexer = shlex.shlex(instream=line, punctuation_chars=True)
tokens = []
while True: