mirror of
https://github.com/morluto/rea.git
synced 2026-10-12 02:19:24 +00:00
@@ -35,6 +35,12 @@ 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.
|
||||
// `realpath` is expected to fail when the target or a path component is
|
||||
// missing (ENOENT, ENOTDIR), unreadable (EACCES), or a symlink loop (ELOOP).
|
||||
// The lexical `resolve` fallback still yields a deterministic key, so the
|
||||
// only cost is that symlinked spellings of such a path may take separate
|
||||
// leases.
|
||||
const targetPath = await realpath(input.targetPath).catch(() =>
|
||||
resolve(input.targetPath),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user