lib.ec.ssh.Paramiko: Fix URI parameters, stdin handling, and output deadlock #85
1 changed files with 1 additions and 0 deletions
lib.ec.ssh.Paramiko: Close remote stdin
_run_ssh() writes cmd_input to the remote stdin channel but never closes the write side. The channel stays open until the client process exits, so a remote command that reads stdin (cat, a login shell, ...) never sees EOF and blocks forever - including for cmd_input = None, which is supposed to mean non-interactive with stdin from /dev/null. Call shutdown_write() on the channel after writing the input, or immediately when there is none, so the remote command gets EOF. Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2 Signed-off-by: Jan Lindemann <jan@janware.com>
commit
4ca370a877
|
|
@ -94,5 +94,6 @@ class Paramiko(Base):
|
||||||
raise
|
raise
|
||||||
if cmd_input is not None:
|
if cmd_input is not None:
|
||||||
stdin.write(cmd_input)
|
stdin.write(cmd_input)
|
||||||
|
stdin.channel.shutdown_write()
|
||||||
exit_status = stdout.channel.recv_exit_status()
|
exit_status = stdout.channel.recv_exit_status()
|
||||||
return Result(stdout.read(), stderr.read(), exit_status, cmd = cmd)
|
return Result(stdout.read(), stderr.read(), exit_status, cmd = cmd)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue