{"record":{"id":"d430293786f97972","repo":"openai/codex","slug":"operation-failed-for-code","errorCode":null,"errorMessage":"{operation} failed for {}: {code}","messagePattern":"(.+?) failed for (.+?): (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/acl.rs","lineNumber":63,"sourceCode":"use windows_sys::Win32::Storage::FileSystem::FILE_WRITE_ATTRIBUTES;\nuse windows_sys::Win32::Storage::FileSystem::FILE_WRITE_DATA;\nuse windows_sys::Win32::Storage::FileSystem::FILE_WRITE_EA;\nuse windows_sys::Win32::Storage::FileSystem::OPEN_EXISTING;\nuse windows_sys::Win32::Storage::FileSystem::READ_CONTROL;\nconst SE_KERNEL_OBJECT: u32 = 6;\nconst INHERIT_ONLY_ACE: u8 = 0x08;\nconst INHERITED_ACE: u8 = 0x10;\nconst ACCESS_ALLOWED_ACE_TYPE: u8 = 0;\nconst ACCESS_DENIED_ACE_TYPE: u8 = 1;\nconst GENERIC_READ_MASK: u32 = 0x8000_0000;\nconst GENERIC_WRITE_MASK: u32 = 0x4000_0000;\nconst DENY_ACCESS: i32 = 3;\n\nfn acl_api_result(path: &Path, operation: &str, code: u32) -> Result<()> {\n    if code == ERROR_SUCCESS {\n        Ok(())\n    } else {\n        Err(anyhow!(\"{operation} failed for {}: {code}\", path.display()))\n    }\n}\n\n/// Fetch DACL via handle-based query; caller must LocalFree the returned SD.\n///\n/// # Safety\n/// Caller must free the returned security descriptor with `LocalFree` and pass an existing path.\npub unsafe fn fetch_dacl_handle(path: &Path) -> Result<(*mut ACL, *mut c_void)> {\n    let wpath = to_wide(path);\n    let h = CreateFileW(\n        wpath.as_ptr(),\n        READ_CONTROL,\n        FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,\n        std::ptr::null_mut(),\n        OPEN_EXISTING,\n        FILE_FLAG_BACKUP_SEMANTICS,\n        0,\n    );","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/acl.rs#L45-L81","documentation":"Error \"{operation} failed for {}: {code}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/acl.rs:63 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}