mirror of
https://github.com/cowrie/cowrie.git
synced 2025-07-01 18:07:27 -04:00
fix exit on unknown command (#1701)
Co-authored-by: Michel Oosterhof <michel@MacBook-Pro.local>
This commit is contained in:
@ -317,6 +317,11 @@ class HoneyPotShell:
|
|||||||
"utf8"
|
"utf8"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not self.interactive:
|
||||||
|
stat = failure.Failure(error.ProcessDone(status=""))
|
||||||
|
self.protocol.terminal.transport.processEnded(stat)
|
||||||
|
|
||||||
runOrPrompt()
|
runOrPrompt()
|
||||||
pp = None # Got a error. Don't run any piped commands
|
pp = None # Got a error. Don't run any piped commands
|
||||||
break
|
break
|
||||||
@ -374,10 +379,8 @@ class HoneyPotShell:
|
|||||||
|
|
||||||
def handle_CTRL_D(self) -> None:
|
def handle_CTRL_D(self) -> None:
|
||||||
log.msg("Received CTRL-D, exiting..")
|
log.msg("Received CTRL-D, exiting..")
|
||||||
|
stat = failure.Failure(error.ProcessDone(status=""))
|
||||||
cmdclass = self.protocol.commands["exit"]
|
self.protocol.terminal.transport.processEnded(stat)
|
||||||
pp = StdOutStdErrEmulationProtocol(self.protocol, cmdclass, None, None, None)
|
|
||||||
self.protocol.call_command(pp, self.protocol.commands["exit"])
|
|
||||||
|
|
||||||
def handle_TAB(self) -> None:
|
def handle_TAB(self) -> None:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user