fix: execute ProxyCommand transport - #293
Merged
Merged
Conversation
Route resolved ProxyCommand values through a managed shell child and use its standard streams as the SSH transport. Expand OpenSSH proxy tokens, preserve ProxyJump precedence and explicit none, surface bounded stderr and exit status, and reject unsupported descriptor passing before spawn. Preserve original host aliases through ssh_config resolution, carry raw-stream exit status after stdout and stderr, and keep draining SSH when the local output receiver closes.
Order exact and explicit-disable host blocks before wildcard fallbacks so the connection-manager fixtures match OpenSSH resolution semantics.
Place the exact host before its wildcard fallback in the bssh binary test so it exercises OpenSSH first-obtained behavior.
Keep network KnownHostsCommand values rejected while proving URL-internal equals signs survive line parsing and safe equals-bearing arguments remain accepted.
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.
Summary
ProxyCommandvalues as managed shell child transports instead of silently opening a direct target socket.ProxyCommand,ProxyJump, command-line-J, explicitnone, and effective%h/%k/%ntoken identities.ProxyUseFdpassbefore spawning a process.Implementation
%%,%h,%k,%n,%p, and%r, reject malformed or unsupported tokens, and preserve shell pipes and quoting from trusted SSH configuration.-Jtaking precedence.SecurityKeyProvideroption while retaining diagnostics for genuinely unknown keywords.ProxyUseFdpasslimitation.Security and quality review
Validation
cargo fmt --all -- --checkcargo test --lib proxy(29 passed)cargo test --lib resolve_effective_jump_hosts(11 passed)cargo test --lib stream_exit(2 passed)cargo test --lib nonzero_stream_completion_preserves_remote_status(1 passed)cargo test --lib closed_output_receiver_is_not_a_command_error(1 passed)cargo test --test ssh_compat_output_test deprecated_alias_is_silent_and_unknown_keyword_uses_log_file -- --exact(1 passed)cargo check --lib --testscargo clippy --lib --tests -- -D warningscargo build --bin bsshcargo test --bin bssh(57 passed)TEST_SSH_UNSAFE_PERMISSIONS=1 python3 tests/openssh-regress/run.py --bssh target/debug/bssh --test proxy-connect --jobs 1 --timeout 120(PASS, 1/1)Local CI-equivalent note:
cargo test --tests -- --skip integration_testpassed the library tests (1420 passed, 9 ignored, 13 filtered), the bssh binary tests (57 passed), and the subsequent keygen/server and independent test targets untiltests/integration_test.rs; three unchanged localhost SSH-dependent cases failed in the local harness (test_localhost_multiple_file_upload,test_parallel_execution_with_multiple_nodes, andtest_download_with_unique_filenames). The PR's exact-head GitHub checks are the authoritative CI verdict for those environment-dependent cases.Closes #280