B #7717: Fix sshwrap to prevent ssh from consuming following shell input#7718
Open
tomatomov wants to merge 1 commit into
Open
B #7717: Fix sshwrap to prevent ssh from consuming following shell input#7718tomatomov wants to merge 1 commit into
tomatomov wants to merge 1 commit into
Conversation
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.
Signed-off-by: Toma Tomov <toma.tomov@gmail.com>
e112885 to
15133c2
Compare
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes the
sshwraphelper so thatsshdoes not consume input intended for subsequent commands in the calling shell (e.g., thewhile readloops used during RBD snapshot cleanup). This avoids truncated/skipped iterations when cleaning up snapshots over SSH.Closes #7717
Changes
-n(or redirect stdin from/dev/null) insshwrapsosshdoes not read from the parent shell's stdin.Testing
sshwrap.Branches to which this PR applies