Merge pull request #94 from davegermiquet/echochange

Fixed echo bug where session would hang.
This commit is contained in:
Michel Oosterhof
2015-12-24 00:23:44 +04:00

View File

@@ -138,15 +138,23 @@ class command_echo(HoneyPotCommand):
"""
write_fn = self.writeln
escape_fn = lambda s: s
optlist, args = getopt.getopt(self.args, "eEn")
"""
"""
for opt in optlist:
if opt[0] == '-e':
escape_fn = functools.partial(str.decode, encoding="string_escape")
elif opt[0] == '-E':
escape_fn = lambda s: s
elif opt[0] == '-n':
write_fn = self.write
try:
write_fn = self.writeln
optlist, args = getopt.getopt(self.args, "eEn")
for opt in optlist:
if opt[0] == '-e':
escape_fn = functools.partial(str.decode, encoding="string_escape")
elif opt[0] == '-E':
escape_fn = lambda s: s
elif opt[0] == '-n':
write_fn = self.write
except:
write_fn = self.writeln
args = self.args
write_fn(escape_fn(' '.join(args)))