From 6763b09008085f753d3ca72c1d0d7cf2bf4eab96 Mon Sep 17 00:00:00 2001 From: Drew Newberry Date: Tue, 13 Oct 2026 08:13:10 -0700 Subject: [PATCH] fix(mxc): resolve Windows lint and generated binding drift Signed-off-by: Drew Newberry --- crates/openshell-mxc-boundary/src/socket_owner.rs | 12 +++++------- sdk/go/proto/sandboxv1/sandbox.pb.go | 1 + 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/openshell-mxc-boundary/src/socket_owner.rs b/crates/openshell-mxc-boundary/src/socket_owner.rs index ca751f906..6f5d8a0e6 100644 --- a/crates/openshell-mxc-boundary/src/socket_owner.rs +++ b/crates/openshell-mxc-boundary/src/socket_owner.rs @@ -177,7 +177,7 @@ fn tcp_table(address_family: u32) -> Result<(Vec, usize)> { for _ in 0..3 { let mut buffer = vec![0u32; (byte_len as usize).div_ceil(size_of::()).max(1)]; let mut actual_len = u32::try_from(buffer.len() * size_of::()) - .map_err(|_| format!("TCP table buffer is too large"))?; + .map_err(|_| "TCP table buffer is too large".to_string())?; // SAFETY: The u32-backed buffer has sufficient alignment and capacity // for the requested byte count. The API writes at most `actual_len` // bytes and updates it when the table grows concurrently. @@ -203,9 +203,7 @@ fn tcp_table(address_family: u32) -> Result<(Vec, usize)> { byte_len = actual_len; } - Err(format!( - "GetExtendedTcpTable changed size during three consecutive reads" - )) + Err("GetExtendedTcpTable changed size during three consecutive reads".to_string()) } fn table_rows( @@ -215,7 +213,7 @@ fn table_rows( row_stride: usize, ) -> Result> { if byte_len < size_of::() { - return Err(format!("Windows TCP table is missing its header")); + return Err("Windows TCP table is missing its header".to_string()); } if row_stride < size_of::() { return Err(format!( @@ -231,10 +229,10 @@ fn table_rows( .checked_add( (count - 1) .checked_mul(row_stride) - .ok_or_else(|| format!("Windows TCP row count overflow"))?, + .ok_or_else(|| "Windows TCP row count overflow".to_string())?, ) .and_then(|last_row| last_row.checked_add(size_of::())) - .ok_or_else(|| format!("Windows TCP table size overflow"))? + .ok_or_else(|| "Windows TCP table size overflow".to_string())? }; if required > byte_len || required > size_of_val(buffer) { return Err(format!( diff --git a/sdk/go/proto/sandboxv1/sandbox.pb.go b/sdk/go/proto/sandboxv1/sandbox.pb.go index 83d114387..bd23ee0c2 100644 --- a/sdk/go/proto/sandboxv1/sandbox.pb.go +++ b/sdk/go/proto/sandboxv1/sandbox.pb.go @@ -979,6 +979,7 @@ type NetworkEndpoint struct { // When non-empty, the SSRF internal-IP check is replaced by an allowlist check: // - If host is also set: domain must resolve to an IP in this list. // - If host is empty: any domain is allowed as long as it resolves to an IP in this list. + // // Supports exact IPs ("10.0.5.20") and CIDR notation ("10.0.5.0/24"). // Loopback (127.0.0.0/8) and link-local (169.254.0.0/16) are always blocked // regardless of this field.