docs+test: the young-run window in SERVER-MODE/LANES; run.test plants its link in the real drop dir
run.test.js hardcoded /tmp/agenthub-drops-<uid>, which drops left for <data dir>/drops long ago — it passed only while an old build's folder survived in /tmp (gone after a reboot). Full suites: server 2887/2887, client 1250/1250.
This commit is contained in:
@@ -335,17 +335,15 @@ describe("GET /api/run/drop/:name", () => {
|
||||
});
|
||||
|
||||
it("serves no file that is not a dropped image or text file", async () => {
|
||||
const link = path.join(
|
||||
os.tmpdir(),
|
||||
`agenthub-drops-${os.userInfo().uid}`,
|
||||
"fedcba9876543210.png"
|
||||
);
|
||||
fs.rmSync(link, { force: true });
|
||||
fs.symlinkSync("/etc/passwd", link);
|
||||
const pdf = await fetchJson("/api/run/drop-file?name=a.pdf", {
|
||||
method: "POST",
|
||||
raw: { type: "application/pdf", buf: Buffer.from("%PDF") },
|
||||
});
|
||||
// Planted in the real drop dir (the one this drop just made), not a
|
||||
// guessed path: `<data dir>/drops` replaced `/tmp/agenthub-drops-<uid>`.
|
||||
const link = path.join(path.dirname(pdf.body.path), "fedcba9876543210.png");
|
||||
fs.rmSync(link, { force: true });
|
||||
fs.symlinkSync("/etc/passwd", link);
|
||||
for (const name of [
|
||||
path.basename(pdf.body.path), // a drop, but no image
|
||||
"0123456789abcdef.png", // the right shape, never dropped
|
||||
|
||||
Reference in New Issue
Block a user