Skip to content

Commit e112885

Browse files
authored
Fix sshwrap to prevent ssh from consuming following shell input
TransferManager::Shell.sshwrap currently invokes remote commands using ssh '#{host}' .... In some environments this causes ssh to read from stdin and consume the remaining commands from the generated local shell script. As a result, commands following the wrapped SSH call may be interpreted as input to ssh instead of being executed by the local shell. This can break snapshot cleanup flows, for example RBD snapshot deletion, where subsequent commands are skipped or not processed as expected. Adding -n prevents ssh from reading stdin by redirecting it from /dev/null. This makes sshwrap safer for non-interactive execution and avoids relying on distro-specific or host-specific SSH client configuration such as StdinNull.
1 parent 26018a3 commit e112885

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/tm_mad/lib/shell.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def self.sshwrap(host, cmd)
304304
cmd
305305
else
306306
<<~EOF.strip
307-
ssh '#{host}' '\
307+
ssh -n '#{host}' '\
308308
script="$(mktemp)"; \
309309
echo "#{Base64.strict_encode64(cmd)}" | base64 -d > "$script"; \
310310
trap "rm $script" EXIT; \

0 commit comments

Comments
 (0)