Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/runtime/sandbox/bwrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ impl ToolExecutor for RealSandbox {
// convention `128 + signum` so callers can detect
// SIGSYS (signal 31 -> exit_code 159) without a
// schema change.
exit_code: out.status.code().unwrap_or_else(|| {
exit_code: out.status.code().unwrap_or({
use std::os::unix::process::ExitStatusExt;
out.status.signal().map(|s| 128 + s).unwrap_or(-1)
}),
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/sandbox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl ToolExecutor for ProcessExecutor {
// via the POSIX `128 + signum` convention so SIGSYS
// (31) appears as exit_code 159 to callers, matching
// the bwrap path.
exit_code: out.status.code().unwrap_or_else(|| {
exit_code: out.status.code().unwrap_or({
#[cfg(unix)]
{
use std::os::unix::process::ExitStatusExt;
Expand Down
5 changes: 5 additions & 0 deletions src/runtime/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ struct ShellExecution {
/// terminations are translated to `128 + signum` (POSIX
/// convention) so SIGSYS appears as 159. -1 if no code and no
/// signal could be observed (e.g. wait error / timeout).
#[cfg(target_os = "linux")]
exit_code: i32,
#[cfg(target_os = "linux")]
audit_pids: Vec<u32>,
Expand Down Expand Up @@ -661,25 +662,29 @@ async fn execute_shell(
};
ShellExecution {
result: ToolResult::Output(truncated),
#[cfg(target_os = "linux")]
exit_code,
#[cfg(target_os = "linux")]
audit_pids: _audit_pids,
}
}
ExecResult::Timeout => ShellExecution {
result: ToolResult::Error("Shell execution timed out".into()),
#[cfg(target_os = "linux")]
exit_code: -1,
#[cfg(target_os = "linux")]
audit_pids: Vec::new(),
},
ExecResult::Rejected(reason) => ShellExecution {
result: ToolResult::Error(format!("Shell execution rejected: {reason}")),
#[cfg(target_os = "linux")]
exit_code: -1,
#[cfg(target_os = "linux")]
audit_pids: Vec::new(),
},
ExecResult::Err(e) => ShellExecution {
result: ToolResult::Error(format!("Shell execution failed: {e}")),
#[cfg(target_os = "linux")]
exit_code: -1,
#[cfg(target_os = "linux")]
audit_pids: Vec::new(),
Expand Down
Loading