Handle redirection in shell (#1095)

This commit is contained in:
Mehtab Zafar 2019-08-20 14:21:00 +05:30 committed by Michel Oosterhof
parent 4789223ea0
commit 16fac8856d
1 changed files with 3 additions and 0 deletions

View File

@ -43,6 +43,9 @@ class HoneyPotCommand(object):
# MS-DOS style redirect handling, inside the command
# TODO: handle >>, 2>, etc
if '>' in self.args or '>>' in self.args:
if self.args[-1] in ['>', ">>"]:
self.errorWrite("-bash: parse error near '\\n' \n")
return
self.writtenBytes = 0
self.writefn = self.write_to_file
if '>>' in self.args: