Restore read-only mounts before landlock

This commit is contained in:
daveaitel-openai
2026-01-20 12:08:01 -05:00
parent 99f47d6e9a
commit 21e99b818c
+3
View File
@@ -7,6 +7,8 @@ use codex_core::error::SandboxErr;
use codex_core::protocol::SandboxPolicy;
use codex_utils_absolute_path::AbsolutePathBuf;
use crate::mounts::apply_read_only_mounts;
use landlock::ABI;
use landlock::Access;
use landlock::AccessFs;
@@ -40,6 +42,7 @@ pub(crate) fn apply_sandbox_policy_to_current_thread(
}
if !sandbox_policy.has_full_disk_write_access() {
apply_read_only_mounts(sandbox_policy, cwd)?;
let writable_roots = sandbox_policy
.get_writable_roots_with_cwd(cwd)
.into_iter()