ssh: close stdin when running subshell

nistp521
Roman Zeyde 7 years ago
parent 7598f6cdbf
commit 0b829636e1
No known key found for this signature in database
GPG Key ID: 87CAE5FA46917CBB

@ -35,7 +35,7 @@ class Trezor(interface.Device):
return self._defs.PassphraseAck(passphrase=self.passphrase)
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
def qt_handler(_):

@ -210,6 +210,7 @@ def main(device_type):
use_shell = bool(args.shell)
if use_shell:
command = os.environ['SHELL']
sys.stdin.close()
conn = JustInTimeConnection(
conn_factory=lambda: client.Client(device_type()),

Loading…
Cancel
Save