{"record":{"id":"aa9874cf41c24787","repo":"openai/codex","slug":"setentriesinaclw-sandbox-dir-failed-set","errorCode":null,"errorMessage":"SetEntriesInAclW sandbox dir failed: {set}","messagePattern":"SetEntriesInAclW sandbox dir failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/bin/setup_main/win.rs","lineNumber":371,"sourceCode":"                grfInheritance: OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE,\n                Trustee: TRUSTEE_W {\n                    pMultipleTrustee: std::ptr::null_mut(),\n                    MultipleTrusteeOperation: 0,\n                    TrusteeForm: TRUSTEE_IS_SID,\n                    TrusteeType: TRUSTEE_IS_SID,\n                    ptstrName: psid as *mut u16,\n                },\n            });\n        }\n        let mut new_dacl: *mut ACL = std::ptr::null_mut();\n        let set = SetEntriesInAclW(\n            eas.len() as u32,\n            eas.as_ptr(),\n            std::ptr::null_mut(),\n            &mut new_dacl,\n        );\n        if set != 0 {\n            return Err(anyhow::anyhow!(\n                \"SetEntriesInAclW sandbox dir failed: {set}\",\n            ));\n        }\n        let (res, api) = match directory.as_ref() {\n            Some(directory) => (\n                SetSecurityInfo(\n                    directory.as_raw_handle() as _,\n                    SE_FILE_OBJECT,\n                    DACL_SECURITY_INFORMATION,\n                    std::ptr::null_mut(),\n                    std::ptr::null_mut(),\n                    new_dacl,\n                    std::ptr::null_mut(),\n                ),\n                \"SetSecurityInfo\",\n            ),\n            None => {\n                let path_w = to_wide(dir.as_os_str());","sourceCodeStart":353,"sourceCodeEnd":389,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/bin/setup_main/win.rs#L353-L389","documentation":"SetEntriesInAclW returned a nonzero Win32 error while building the new DACL from the sandbox directory ACE list. The ACL could not be constructed from the trustee entries (e.g. an invalid SID or malformed access mask), and the error code identifies which entry or parameter was rejected.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/bin/setup_main/win.rs:371 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Decode the returned code: ERROR_INVALID_PARAMETER or ERROR_NONE_MAPPED typically points at a bad trustee SID in the entries list","Re-resolve the sandbox group/user SIDs to ensure they are valid before re-running setup","Free any partially built ACL with LocalFree on retry and confirm the trustee forms (TRUSTEE_IS_SID) match the supplied pointers"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}