{"record":{"id":"4cbe0e4296ee70e2","repo":"openai/codex","slug":"setentriesinaclw-failed-for-private-desktop-set","errorCode":null,"errorMessage":"SetEntriesInAclW failed for private desktop: {set_entries_code}","messagePattern":"SetEntriesInAclW failed for private desktop: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/desktop.rs","lineNumber":158,"sourceCode":"            TrusteeForm: TRUSTEE_IS_SID,\n            TrusteeType: TRUSTEE_IS_UNKNOWN,\n            ptstrName: logon_sid.as_mut_ptr() as *mut c_void as *mut u16,\n        },\n    }];\n\n    let mut updated_dacl = ptr::null_mut();\n    let set_entries_code = SetEntriesInAclW(\n        entries.len() as u32,\n        entries.as_ptr(),\n        ptr::null_mut(),\n        &mut updated_dacl,\n    );\n    if set_entries_code != ERROR_SUCCESS {\n        logging::debug_log(\n            &format!(\"SetEntriesInAclW failed for private desktop: {set_entries_code}\"),\n            logs_base_dir,\n        );\n        return Err(anyhow::anyhow!(\n            \"SetEntriesInAclW failed for private desktop: {set_entries_code}\"\n        ));\n    }\n\n    let set_security_code = SetSecurityInfo(\n        handle,\n        SE_WINDOW_OBJECT,\n        DACL_SECURITY_INFORMATION,\n        ptr::null_mut(),\n        ptr::null_mut(),\n        updated_dacl,\n        ptr::null_mut(),\n    );\n    if !updated_dacl.is_null() {\n        LocalFree(updated_dacl as HLOCAL);\n    }\n    if set_security_code != ERROR_SUCCESS {\n        logging::debug_log(","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/desktop.rs#L140-L176","documentation":"SetEntriesInAclW returned a code other than ERROR_SUCCESS while building the DACL that grants the logon SID full access to the private desktop. The trustee entry is malformed or the SID invalid, so the desktop's restrictive ACL cannot be constructed; the code is also written to the debug log.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/desktop.rs:158 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Decode the returned code: ERROR_INVALID_PARAMETER or ERROR_NONE_MAPPED points at an invalid logon SID trustee","Ensure the logon SID buffer used for the TRUSTEE_W entry is a valid SID obtained from the process token","Re-run the sandbox launch so a fresh logon SID and desktop are created"],"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"}