lib.ec.ssh.Paramiko: Fix URI parameters, stdin handling, and output deadlock #85

Merged
Jan Lindemann merged 3 commits from jan/fix/20260905-lib-ec-ssh-paramiko-fix-uri-parameters-stdin-handling-and-output-deadlock into master 2026-09-05 19:09:29 +02:00 AGit
Showing only changes of commit 4ca370a877 - Show all commits

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>
Jan Lindemann 2026-08-16 07:02:25 +02:00
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)