mirror of
https://github.com/wez/wezterm.git
synced 2024-11-22 04:56:12 +03:00
Implement ProxyUseFDpass for ssh
This allows the ProxyUseFDpass ssh config option, to be used on Linux and Mac OS. This was requested in enhancement issue #6093
This commit is contained in:
parent
43d221f52f
commit
caf450b873
10
Cargo.lock
generated
10
Cargo.lock
generated
@ -3656,6 +3656,15 @@ dependencies = [
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "passfd"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b332c50e4d07c0011fff51ea305374408319908908bc1dbed7a0ffaaf63a8151"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "paste"
|
||||
version = "1.0.15"
|
||||
@ -6479,6 +6488,7 @@ dependencies = [
|
||||
"libssh-rs",
|
||||
"log",
|
||||
"once_cell",
|
||||
"passfd",
|
||||
"portable-pty",
|
||||
"predicates",
|
||||
"regex",
|
||||
|
@ -40,6 +40,9 @@ wezterm-uds = { path = "../wezterm-uds" }
|
||||
# Not used directly, but is used to centralize the openssl vendor feature selection
|
||||
async_ossl = { path = "../async_ossl" }
|
||||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
passfd = "0.1.6"
|
||||
|
||||
[dev-dependencies]
|
||||
assert_fs = "1.0.4"
|
||||
clap = {version="4.0", features=["derive"]}
|
||||
|
@ -357,11 +357,16 @@ impl SessionInner {
|
||||
|
||||
#[cfg(unix)]
|
||||
unsafe {
|
||||
use passfd::FdPassingExt;
|
||||
use std::os::unix::io::{FromRawFd, IntoRawFd};
|
||||
return Ok((
|
||||
Socket::from_raw_fd(a.into_raw_fd()),
|
||||
Some(KillOnDropChild(child)),
|
||||
));
|
||||
|
||||
let raw = a.into_raw_fd();
|
||||
let dest = match self.config.get("proxyusefdpass").map(|s| s.as_str()) {
|
||||
Some("yes") => raw.recv_fd()?,
|
||||
_ => raw,
|
||||
};
|
||||
|
||||
return Ok((Socket::from_raw_fd(dest), Some(KillOnDropChild(child))));
|
||||
}
|
||||
#[cfg(windows)]
|
||||
unsafe {
|
||||
|
Loading…
Reference in New Issue
Block a user