Skip to content

armgit / rea

Public Imported from GitHub
0

Reverse engineer anything with agents, from app behavior down to native binaries.

docs(hopper): document HopperTargetLease realpath fallback (#711)

Vinay Prasadd3f498ceec65
diff --git a/src/hopper/HopperTargetLease.ts b/src/hopper/HopperTargetLease.ts
index 9203c7c77..d07518781 100644
--- a/src/hopper/HopperTargetLease.ts
+++ b/src/hopper/HopperTargetLease.ts
@@ -35,6 +35,13 @@ export const acquireHopperTargetLease = async (input: {
}): Promise<HopperTargetLeaseAcquisition> => {
const directory = input.directory ?? leaseDirectory;
await ensureLeaseDirectory(directory);
+ // The canonical path only derives the lease key; it never authorizes access.
+ // Common expected `realpath` failures include a missing target or path
+ // component (ENOENT, ENOTDIR), an unreadable component (EACCES), or a
+ // symlink loop (ELOOP). This catch also falls back for every other error,
+ // which may hide a real filesystem problem. The lexical `resolve` fallback
+ // still yields a deterministic key, but aliases may take separate leases
+ // whenever `realpath` cannot resolve them.
const targetPath = await realpath(input.targetPath).catch(() =>
resolve(input.targetPath),
);