{"record":{"id":"61d66cf20ff4763d","repo":"openai/codex","slug":"permissiondenied-61d66c","errorCode":"PermissionDenied","errorMessage":"LookupAccountNameW failed for {name}: {err}","messagePattern":"LookupAccountNameW failed for (.+?): (.+?)","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/elevated/runner_pipe.rs","lineNumber":58,"sourceCode":"\n/// Resolves the elevated command runner path, preferring the copied helper under\n/// `.sandbox-bin` and falling back to the legacy sibling lookup when needed.\npub fn find_runner_exe(codex_home: &Path, log_dir: Option<&Path>) -> PathBuf {\n    resolve_helper_for_launch(HelperExecutable::CommandRunner, codex_home, log_dir)\n}\n\n/// Generates a unique named-pipe path used to communicate with the runner process.\npub fn pipe_pair() -> (String, String) {\n    let mut rng = SmallRng::from_entropy();\n    let nonce: u128 = rng.r#gen();\n    let base = format!(r\"\\\\.\\pipe\\codex-runner-{nonce:x}\");\n    (format!(\"{base}-in\"), format!(\"{base}-out\"))\n}\n\n/// Creates a named pipe whose DACL only allows the sandbox user to connect.\npub fn create_named_pipe(name: &str, access: u32, sandbox_username: &str) -> io::Result<HANDLE> {\n    let sandbox_sid = resolve_sid(sandbox_username)\n        .map_err(|err| io::Error::new(io::ErrorKind::PermissionDenied, err.to_string()))?;\n    let sandbox_sid = string_from_sid_bytes(&sandbox_sid)\n        .map_err(|err| io::Error::new(io::ErrorKind::PermissionDenied, err))?;\n    let sddl = to_wide(format!(\"D:(A;;GA;;;{sandbox_sid})\"));\n    let mut sd: PSECURITY_DESCRIPTOR = ptr::null_mut();\n    let ok = unsafe {\n        ConvertStringSecurityDescriptorToSecurityDescriptorW(\n            sddl.as_ptr(),\n            1, // SDDL_REVISION_1\n            &mut sd,\n            ptr::null_mut(),\n        )\n    };\n    if ok == 0 {\n        return Err(io::Error::from_raw_os_error(unsafe {\n            GetLastError() as i32\n        }));\n    }\n    let mut sa = SECURITY_ATTRIBUTES {","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/elevated/runner_pipe.rs#L40-L76","documentation":"Error \"LookupAccountNameW failed for {name}: {err}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/elevated/runner_pipe.rs:58 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"}