ssh: close stdin when running subshell
This commit is contained in:
@@ -35,7 +35,7 @@ class Trezor(interface.Device):
|
|||||||
return self._defs.PassphraseAck(passphrase=self.passphrase)
|
return self._defs.PassphraseAck(passphrase=self.passphrase)
|
||||||
|
|
||||||
def create_pin_handler(conn):
|
def create_pin_handler(conn):
|
||||||
if os.isatty(sys.stdin.fileno()):
|
if not sys.stdin.closed and os.isatty(sys.stdin.fileno()):
|
||||||
return conn.callback_PinMatrixRequest # CLI-based PIN handler
|
return conn.callback_PinMatrixRequest # CLI-based PIN handler
|
||||||
|
|
||||||
def qt_handler(_):
|
def qt_handler(_):
|
||||||
|
|||||||
@@ -210,6 +210,7 @@ def main(device_type):
|
|||||||
use_shell = bool(args.shell)
|
use_shell = bool(args.shell)
|
||||||
if use_shell:
|
if use_shell:
|
||||||
command = os.environ['SHELL']
|
command = os.environ['SHELL']
|
||||||
|
sys.stdin.close()
|
||||||
|
|
||||||
conn = JustInTimeConnection(
|
conn = JustInTimeConnection(
|
||||||
conn_factory=lambda: client.Client(device_type()),
|
conn_factory=lambda: client.Client(device_type()),
|
||||||
|
|||||||
Reference in New Issue
Block a user