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>
This commit is contained in:
Jan Lindemann 2026-08-16 07:02:25 +02:00
commit 28819d5f49
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -94,5 +94,6 @@ class Paramiko(Base):
raise
if cmd_input is not None:
stdin.write(cmd_input)
stdin.channel.shutdown_write()
exit_status = stdout.channel.recv_exit_status()
return Result(stdout.read(), stderr.read(), exit_status, cmd = cmd)