mirror of
https://github.com/morluto/rea
synced 2026-10-26 06:16:17 -04:00
cc8835c7a3
Preserve renamed-executable identity, complete-line readiness and bounded child lifetimes. Use genuinely malformed Inspector input and explicit ADB file-probe/push/hash facts while preserving cancellation, cleanup, Evidence and completeness assertions. Adopt current main Go fixtures and retain malformed COFF coverage. Fixes #6556 Refs #6480
17 lines
788 B
TypeScript
17 lines
788 B
TypeScript
import { constants } from "node:fs";
|
|
import { chmod, copyFile, symlink } from "node:fs/promises";
|
|
|
|
/** A controlled Node child announces readiness and expires even if its PID is never received. */
|
|
export const retainedRuntimeNodeCode = (displayName?: string): string =>
|
|
`${displayName === undefined ? "" : `process.title = ${JSON.stringify(displayName)}; `}setTimeout(() => process.exit(0), 30_000); process.send('ready');`;
|
|
|
|
/** Give the fixture a distinct executable identity without relying on host multicall utilities. */
|
|
export const prepareRenamedNodeLauncher = async (
|
|
launcher: string,
|
|
alternate: string,
|
|
): Promise<void> => {
|
|
await copyFile(process.execPath, launcher, constants.COPYFILE_FICLONE);
|
|
await chmod(launcher, 0o700);
|
|
await symlink(launcher, alternate);
|
|
};
|