mirror of
https://github.com/openai/codex.git
synced 2026-04-30 17:36:40 +00:00
consolidate world-writable-directories scanning. (#7234)
clean up the code for scanning for world writable directories One path (selecting a sandbox mode from /approvals) was using an incorrect method that did not use the new method of creating deny aces to prevent writing to those directories. Now all paths are the same.
This commit is contained in:
@@ -2380,11 +2380,18 @@ impl ChatWidget {
|
||||
{
|
||||
return None;
|
||||
}
|
||||
let cwd = match std::env::current_dir() {
|
||||
Ok(cwd) => cwd,
|
||||
Err(_) => return Some((Vec::new(), 0, true)),
|
||||
};
|
||||
codex_windows_sandbox::world_writable_warning_details(self.config.codex_home.as_path(), cwd)
|
||||
let cwd = self.config.cwd.clone();
|
||||
let env_map: std::collections::HashMap<String, String> = std::env::vars().collect();
|
||||
match codex_windows_sandbox::apply_world_writable_scan_and_denies(
|
||||
self.config.codex_home.as_path(),
|
||||
cwd.as_path(),
|
||||
&env_map,
|
||||
&self.config.sandbox_policy,
|
||||
Some(self.config.codex_home.as_path()),
|
||||
) {
|
||||
Ok(_) => None,
|
||||
Err(_) => Some((Vec::new(), 0, true)),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
|
||||
Reference in New Issue
Block a user