fix(ida): canonicalize the headless workspace root before opening (#1481)
On macOS the default workspace root is os.tmpdir() under /var/folders, and /var is a symlink to /private/var. idalib-mcp reports the canonical input path from idb_open/idb_list, while REA compared it against the uncanonicalized private copy with normalize(), so every headless IDA analysis failed its identity check (surfacing as unreadable_output) and the spawned idalib worker was never released. Resolve the workspace root with realpath() when allocating the private workspace so the input path REA sends already matches what upstream reports. Co-authored-by: Xingchuan Ma <xingchuan.ma@msn.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Xingchuan Ma
Claude Opus 5.5
parent
24d9337649
commit
de619bd334
@@ -1,6 +1,6 @@
|
||||
import { createHash, randomUUID } from "node:crypto";
|
||||
import { createReadStream, constants } from "node:fs";
|
||||
import { copyFile } from "node:fs/promises";
|
||||
import { copyFile, realpath } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import { basename, join, normalize } from "node:path";
|
||||
import type { BinaryTarget } from "../domain/binaryTargetTypes.js";
|
||||
@@ -39,8 +39,10 @@ export class IdaWorkspace {
|
||||
target: BinaryTarget,
|
||||
root = tmpdir(),
|
||||
): Promise<IdaWorkspace> {
|
||||
// Upstream reports canonical paths (macOS /var -> /private/var), so the
|
||||
// private input path must already be canonical for identity checks.
|
||||
const runtime = await PrivateRuntimeRoot.create({
|
||||
parent: normalize(root),
|
||||
parent: await realpath(normalize(root)),
|
||||
prefix: "rea-ida-",
|
||||
});
|
||||
const inputPath = join(runtime.path, basename(target.path));
|
||||
|
||||
Reference in New Issue
Block a user