@@ -6,14 +6,14 @@ use anyhow::Context;
66use anyhow:: Result ;
77use base64:: Engine ;
88use base64:: engine:: general_purpose:: STANDARD as BASE64 ;
9- use codex_windows_sandbox:: LOG_FILE_NAME ;
109use codex_windows_sandbox:: SETUP_VERSION ;
1110use codex_windows_sandbox:: SetupErrorCode ;
1211use codex_windows_sandbox:: SetupErrorReport ;
1312use codex_windows_sandbox:: SetupFailure ;
1413use codex_windows_sandbox:: add_deny_write_ace;
1514use codex_windows_sandbox:: canonicalize_path;
1615use codex_windows_sandbox:: convert_string_sid_to_sid;
16+ use codex_windows_sandbox:: current_log_file_path;
1717use codex_windows_sandbox:: ensure_allow_mask_aces_with_inheritance;
1818use codex_windows_sandbox:: ensure_allow_write_aces;
1919use codex_windows_sandbox:: extract_setup_failure;
@@ -103,7 +103,7 @@ enum SetupMode {
103103 ReadAclsOnly ,
104104}
105105
106- fn log_line ( log : & mut File , msg : & str ) -> Result < ( ) > {
106+ fn log_line ( log : & mut dyn Write , msg : & str ) -> Result < ( ) > {
107107 let ts = chrono:: Utc :: now ( ) . to_rfc3339 ( ) ;
108108 writeln ! ( log, "[{ts}] {msg}" ) . map_err ( |err| {
109109 anyhow:: Error :: new ( SetupFailure :: new (
@@ -349,7 +349,7 @@ pub fn main() -> Result<()> {
349349 if let Ok ( codex_home) = std:: env:: var ( "CODEX_HOME" ) {
350350 let sbx_dir = sandbox_dir ( Path :: new ( & codex_home) ) ;
351351 let _ = std:: fs:: create_dir_all ( & sbx_dir) ;
352- let log_path = sbx_dir . join ( LOG_FILE_NAME ) ;
352+ let log_path = current_log_file_path ( & sbx_dir ) ;
353353 if let Ok ( mut f) = File :: options ( ) . create ( true ) . append ( true ) . open ( & log_path) {
354354 let _ = writeln ! (
355355 f,
@@ -400,7 +400,7 @@ fn real_main() -> Result<()> {
400400 format ! ( "failed to create sandbox dir {}: {err}" , sbx_dir. display( ) ) ,
401401 ) )
402402 } ) ?;
403- let log_path = sbx_dir . join ( LOG_FILE_NAME ) ;
403+ let log_path = current_log_file_path ( & sbx_dir ) ;
404404 let mut log = File :: options ( )
405405 . create ( true )
406406 . append ( true )
0 commit comments