Skip to content

Commit 1a70f45

Browse files
committed
fix: resolve rebase artifacts (missing impl block, stray brace, per-channel state)
1 parent fa9b617 commit 1a70f45

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

crates/openshell-cli/src/ssh.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,4 +1198,3 @@ mod tests {
11981198
assert!(args.contains(&format!("ServerAliveCountMax={SSH_SERVER_ALIVE_COUNT_MAX}")));
11991199
}
12001200
}
1201-
}

crates/openshell-sandbox/src/ssh.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use crate::sandbox;
1010
#[cfg(target_os = "linux")]
1111
use crate::{register_managed_child, unregister_managed_child};
1212
use miette::{IntoDiagnostic, Result};
13-
use openshell_core::net::enable_tcp_keepalive;
1413
use nix::pty::{Winsize, openpty};
1514
use nix::unistd::setsid;
15+
use openshell_core::net::enable_tcp_keepalive;
1616
use rand_core::OsRng;
1717
use russh::keys::{Algorithm, PrivateKey};
1818
use russh::server::{Auth, Handle, Session};
@@ -542,7 +542,7 @@ impl russh::server::Handler for SshHandler {
542542
self.ca_file_paths.clone(),
543543
&self.provider_env,
544544
)?;
545-
self.input_sender = Some(input_sender);
545+
self.channel_state(channel).input_sender = Some(input_sender);
546546
} else {
547547
warn!(subsystem = name, "unsupported subsystem requested");
548548
session.channel_failure(channel)?;
@@ -1207,8 +1207,8 @@ fn is_loopback_host(host: &str) -> bool {
12071207
#[cfg(test)]
12081208
mod tests {
12091209
use super::*;
1210-
use std::process::Stdio;
12111210
use crate::policy::{FilesystemPolicy, LandlockPolicy, NetworkPolicy, ProcessPolicy};
1211+
use std::process::Stdio;
12121212

12131213
fn test_channel_id(id: u32) -> ChannelId {
12141214
#[allow(unsafe_code)]

crates/openshell-server/src/grpc.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3928,11 +3928,8 @@ async fn start_single_use_ssh_proxy(
39283928

39293929
// Connect to the resolved address directly (not the hostname) to
39303930
// prevent TOCTOU between validation and connection.
3931-
let Ok(connect_result) = tokio::time::timeout(
3932-
SSH_PROXY_CONNECT_TIMEOUT,
3933-
TcpStream::connect(resolved),
3934-
)
3935-
.await
3931+
let Ok(connect_result) =
3932+
tokio::time::timeout(SSH_PROXY_CONNECT_TIMEOUT, TcpStream::connect(resolved)).await
39363933
else {
39373934
warn!(target_host = %target_host, resolved_ip = %resolved.ip(), target_port, "SSH proxy: timed out connecting to sandbox");
39383935
return;

0 commit comments

Comments
 (0)