Merge remote-tracking branch 'origin/feat/dylib-resolution' into feat/dyld-shared-cache
# Conflicts: # docs/product-catalog.json # docs/verification/managed-conformance-manifest.json # skills/reverse-engineer-anything/SKILL.md # src/domain/dylibResolution.test.ts # src/domain/dylibResolution.ts # src/domain/dylibResolutionFindings.ts # src/generatedMcpToolCatalog.ts
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { mkdir, writeFile } from "node:fs/promises";
|
||||
import { chmod, mkdir, writeFile } from "node:fs/promises";
|
||||
import { dirname, join } from "node:path";
|
||||
|
||||
import { describe, expect } from "vitest";
|
||||
@@ -238,3 +238,45 @@ describe("trace-dylib-resolution CLI inputs", () => {
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
describe.skipIf(process.getuid?.() === 0)(
|
||||
"trace-dylib-resolution permissions",
|
||||
() => {
|
||||
cliTest(
|
||||
"reports an unreadable dependency as a permission failure",
|
||||
async ({ cli }) => {
|
||||
const directory = await createTestTempDirectory("rea-dylib-denied-");
|
||||
await writeFiles(directory, {
|
||||
tool: machoImage({
|
||||
commands: [
|
||||
dylibCommand(LC.LOAD_DYLIB, "@loader_path/libsecret.dylib"),
|
||||
],
|
||||
}),
|
||||
"libsecret.dylib": machoImage({ fileType: FILE_TYPE.dylib }),
|
||||
});
|
||||
await chmod(join(directory, "libsecret.dylib"), 0o000);
|
||||
try {
|
||||
const result = await cli.run({
|
||||
arguments: [
|
||||
"trace-dylib-resolution",
|
||||
join(directory, "tool"),
|
||||
"--json",
|
||||
],
|
||||
environment: ENVIRONMENT,
|
||||
});
|
||||
expect(result.exitCode).toBe(1);
|
||||
expect(result.json).toMatchObject({
|
||||
details: {
|
||||
reason: "unavailable",
|
||||
detail: expect.stringContaining(
|
||||
"Permission denied (EACCES) reading libsecret.dylib",
|
||||
),
|
||||
},
|
||||
});
|
||||
} finally {
|
||||
await chmod(join(directory, "libsecret.dylib"), 0o644);
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user