@@ -9,14 +9,9 @@ use std::time::Duration;
99
1010use async_trait:: async_trait;
1111use codex_app_server_protocol:: JSONRPCErrorError ;
12- use codex_protocol:: config_types:: WindowsSandboxLevel ;
13- use codex_protocol:: permissions:: FileSystemSandboxPolicy ;
14- use codex_protocol:: permissions:: NetworkSandboxPolicy ;
15- use codex_protocol:: protocol:: SandboxPolicy ;
1612use codex_sandboxing:: SandboxCommand ;
1713use codex_sandboxing:: SandboxExecRequest ;
1814use codex_sandboxing:: SandboxType ;
19- use codex_sandboxing:: landlock:: CODEX_LINUX_SANDBOX_ARG0 ;
2015use codex_utils_pty:: ExecCommandSession ;
2116use codex_utils_pty:: TerminalSize ;
2217use tokio:: sync:: Mutex ;
@@ -110,14 +105,8 @@ struct ExecServerRuntimeConfig {
110105impl ExecServerRuntimeConfig {
111106 fn detect ( ) -> Self {
112107 let env_path = std:: env:: var_os ( "CODEX_LINUX_SANDBOX_EXE" ) . map ( PathBuf :: from) ;
113- let sibling_path = std:: env:: current_exe ( ) . ok ( ) . and_then ( |current_exe| {
114- current_exe
115- . parent ( )
116- . map ( |parent| parent. join ( CODEX_LINUX_SANDBOX_ARG0 ) )
117- . filter ( |candidate| candidate. exists ( ) )
118- } ) ;
119108 Self {
120- codex_linux_sandbox_exe : env_path. or ( sibling_path ) ,
109+ codex_linux_sandbox_exe : env_path,
121110 }
122111 }
123112}
@@ -523,29 +512,14 @@ fn prepare_exec_launch(
523512 params : & ExecParams ,
524513 runtime : & ExecServerRuntimeConfig ,
525514) -> Result < SandboxExecRequest , JSONRPCErrorError > {
526- let Some ( sandbox) = params. sandbox . as_ref ( ) else {
527- return Ok ( SandboxExecRequest {
528- command : params. argv . clone ( ) ,
529- cwd : params. cwd . clone ( ) ,
530- env : params. env . clone ( ) ,
531- arg0 : params. arg0 . clone ( ) ,
532- network : None ,
533- sandbox : SandboxType :: None ,
534- windows_sandbox_level : WindowsSandboxLevel :: Disabled ,
535- windows_sandbox_private_desktop : false ,
536- sandbox_policy : SandboxPolicy :: DangerFullAccess ,
537- file_system_sandbox_policy : FileSystemSandboxPolicy :: unrestricted ( ) ,
538- network_sandbox_policy : NetworkSandboxPolicy :: Enabled ,
539- } ) ;
540- } ;
541-
542515 let command = build_sandbox_command (
543516 & params. argv ,
544517 params. cwd . as_path ( ) ,
545518 & params. env ,
546- sandbox. additional_permissions . clone ( ) ,
519+ params . sandbox . additional_permissions . clone ( ) ,
547520 ) ?;
548- sandbox
521+ params
522+ . sandbox
549523 . transform (
550524 command,
551525 // TODO: Thread managed-network proxy state across exec-server so
0 commit comments