{"record":{"id":"f753ed71d9a53588","repo":"openai/codex","slug":"getnamedsecurityinfow-failed-for-code","errorCode":null,"errorMessage":"GetNamedSecurityInfoW failed for {}: {code}","messagePattern":"GetNamedSecurityInfoW failed for (.+?): (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/acl.rs","lineNumber":639,"sourceCode":"\nunsafe fn add_deny_ace(path: &Path, psid: *mut c_void, kind: DenyAceKind) -> Result<bool> {\n    let mut p_sd: *mut c_void = std::ptr::null_mut();\n    let mut p_dacl: *mut ACL = std::ptr::null_mut();\n    let code = GetNamedSecurityInfoW(\n        to_wide(path).as_ptr(),\n        1,\n        DACL_SECURITY_INFORMATION,\n        std::ptr::null_mut(),\n        std::ptr::null_mut(),\n        &mut p_dacl,\n        std::ptr::null_mut(),\n        &mut p_sd,\n    );\n    if code != ERROR_SUCCESS {\n        if !p_sd.is_null() {\n            LocalFree(p_sd as HLOCAL);\n        }\n        return Err(anyhow!(\n            \"GetNamedSecurityInfoW failed for {}: {code}\",\n            path.display()\n        ));\n    }\n    let result = if kind.already_present(p_dacl, psid) {\n        Ok(false)\n    } else {\n        let trustee = TRUSTEE_W {\n            pMultipleTrustee: std::ptr::null_mut(),\n            MultipleTrusteeOperation: 0,\n            TrusteeForm: TRUSTEE_IS_SID,\n            TrusteeType: TRUSTEE_IS_UNKNOWN,\n            ptstrName: psid as *mut u16,\n        };\n        let mut explicit: EXPLICIT_ACCESS_W = std::mem::zeroed();\n        explicit.grfAccessPermissions = kind.mask();\n        explicit.grfAccessMode = DENY_ACCESS;\n        explicit.grfInheritance = CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE;","sourceCodeStart":621,"sourceCodeEnd":657,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/acl.rs#L621-L657","documentation":"Error \"GetNamedSecurityInfoW failed for {}: {code}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/acl.rs:639 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"}