Skip to content

armgit / qm

Public Imported from GitHub
0

Multiplayer agent harness for work.

Revert sudoers env_keep provisioning (#2511) and npm allow-remote config (#2512) (#2518)

Regan Bellefe3b0cc9a0e
diff --git a/.npmrc b/.npmrc
index 409efaf06..7253a5cee 100644
--- a/.npmrc
+++ b/.npmrc
@@ -1,2 +1 @@
min-release-age=7
-allow-remote=root
diff --git a/plugins/web-ui/.npmrc b/plugins/web-ui/.npmrc
deleted file mode 100644
index 4c9a5d969..000000000
--- a/plugins/web-ui/.npmrc
+++ /dev/null
@@ -1 +0,0 @@
-allow-remote=all
diff --git a/src/sandbox/agent37-sandbox.ts b/src/sandbox/agent37-sandbox.ts
index 6d36ab8c8..6078a4d6b 100644
--- a/src/sandbox/agent37-sandbox.ts
+++ b/src/sandbox/agent37-sandbox.ts
@@ -6,7 +6,7 @@ import { createKeyedQueue, fetchWithRetry, sleep } from "../util/async.ts";
import { withRequestId, swallowAs, errMessage } from "../util/errors.ts";
import { NonRetryableTurnError } from "../core/turn-error.ts";
import { shq } from "../util/shell.ts";
-import { nonInteractiveShellPrefix, provisionPrepScript } from "./sandbox-env.ts";
+import { nonInteractiveShellPrefix } from "./sandbox-env.ts";
import { createExecProcessSessions, type ExecProcessIo } from "./exec-process-session.ts";
import { materializeRoLayers } from "./ro-layers.ts";
import { createExecExport, createBackendBlobStaging, createExecFileOps, posixJoin } from "./exec-file-ops.ts";
@@ -528,8 +528,8 @@ export function createAgent37Sandbox(workspace: WorkspaceStore, opts: Agent37San
};
try {
- const credLinks = scratch ? null : ephemeralCredLinkScript(HOME_DIR, opts.credentialPaths ?? []);
- const prep = await execRaw(name, provisionPrepScript(workspaceDir, credLinks), 60);
+ const credLinks = scratch ? "" : ` && ${ephemeralCredLinkScript(HOME_DIR, opts.credentialPaths ?? [])}`;
+ const prep = await execRaw(name, `mkdir -p ${shq(workspaceDir)}${credLinks}`, 60);
if (prep.code !== 0)
throw new Error(`agent37 provision prep failed: ${(prep.stderr || prep.stdout).slice(0, 200)}`);
diff --git a/src/sandbox/aws-sandbox.ts b/src/sandbox/aws-sandbox.ts
index 18c068799..9bf1419a0 100644
--- a/src/sandbox/aws-sandbox.ts
+++ b/src/sandbox/aws-sandbox.ts
@@ -9,7 +9,7 @@ import { createKeyedQueue } from "../util/async.ts";
import { scopeStorageKey } from "../../cli/src/scope-storage-key.ts";
import { swallowAs, errMessage } from "../util/errors.ts";
import { shq } from "../util/shell.ts";
-import { nonInteractiveShellPrefix, provisionPrepScript } from "./sandbox-env.ts";
+import { nonInteractiveShellPrefix } from "./sandbox-env.ts";
import { createExecProcessSessions, type ExecProcessIo } from "./exec-process-session.ts";
import { materializeRoLayers } from "./ro-layers.ts";
import {
@@ -439,7 +439,7 @@ export function createAwsSandbox(workspace: WorkspaceStore, opts: AwsSandboxOpti
try {
const prepared = await execRaw(
id,
- provisionPrepScript(WORKSPACE_DIR, ephemeralCredLinkScript(HOME_DIR, credentialPaths)),
+ `mkdir -p ${shq(WORKSPACE_DIR)} && ${ephemeralCredLinkScript(HOME_DIR, credentialPaths)}`,
PREP_TIMEOUT_SEC,
);
if (prepared.code !== 0)
diff --git a/src/sandbox/e2b-sandbox.ts b/src/sandbox/e2b-sandbox.ts
index f31c194ea..c2a7ab9ff 100644
--- a/src/sandbox/e2b-sandbox.ts
+++ b/src/sandbox/e2b-sandbox.ts
@@ -7,12 +7,7 @@ import type { AdvisoryLock } from "../persistence/advisory-lock.ts";
import { createKeyedQueue } from "../util/async.ts";
import { swallowAs, errMessage } from "../util/errors.ts";
import { shq } from "../util/shell.ts";
-import {
- nonInteractiveShellPrefix,
- DROPPED_PROXY_ENV,
- forceThroughProxyEnv,
- provisionPrepScript,
-} from "./sandbox-env.ts";
+import { nonInteractiveShellPrefix, DROPPED_PROXY_ENV, forceThroughProxyEnv } from "./sandbox-env.ts";
import { createExecProcessSessions, type ExecProcessIo } from "./exec-process-session.ts";
import { materializeRoLayers } from "./ro-layers.ts";
import { createLayerToolInstaller } from "./layer-tool-install.ts";
@@ -436,8 +431,8 @@ export function createE2bSandbox(workspace: WorkspaceStore, opts: E2bSandboxOpti
};
try {
- const credLinks = scratch ? null : ephemeralCredLinkScript(HOME_DIR, opts.credentialPaths ?? []);
- const prep = await execRaw(name, provisionPrepScript(workspaceDir, credLinks), 60);
+ const credLinks = scratch ? "" : ` && ${ephemeralCredLinkScript(HOME_DIR, opts.credentialPaths ?? [])}`;
+ const prep = await execRaw(name, `mkdir -p ${shq(workspaceDir)}${credLinks}`, 60);
if (prep.code !== 0)
throw new Error(`e2b provision prep failed: ${(prep.stderr || prep.stdout).slice(0, 200)}`);
diff --git a/src/sandbox/exec-sandbox-base.ts b/src/sandbox/exec-sandbox-base.ts
index 3a3ce94e6..fa6c8eb62 100644
--- a/src/sandbox/exec-sandbox-base.ts
+++ b/src/sandbox/exec-sandbox-base.ts
@@ -6,12 +6,7 @@ import { createKeyedQueue } from "../util/async.ts";
import { swallowAs, errMessage } from "../util/errors.ts";
import { shq } from "../util/shell.ts";
import { shortHash } from "../util/crypto.ts";
-import {
- DROPPED_PROXY_ENV,
- forceThroughProxyEnv,
- nonInteractiveShellPrefix,
- provisionPrepScript,
-} from "./sandbox-env.ts";
+import { DROPPED_PROXY_ENV, forceThroughProxyEnv, nonInteractiveShellPrefix } from "./sandbox-env.ts";
import { materializeRoLayers } from "./ro-layers.ts";
import type { LayerToolInstaller } from "./layer-tool-install.ts";
import { posixJoin } from "./exec-file-ops.ts";
@@ -194,8 +189,8 @@ export function createExecSandboxBase(deps: ExecSandboxBaseDeps): ExecSandboxBas
);
const env = forceEgress ? forceThroughProxyEnv(deps.egressProxyUrl!, provOpts!.egressToken!, turnEnv) : turnEnv;
if (Object.keys(env).length) handle.env = env;
- const credLinks = scratch ? null : ephemeralCredLinkScript(homeDir, deps.credentialPaths);
- const prepare = provisionPrepScript(workspaceDir, credLinks);
+ const credLinks = scratch ? "" : ` && ${ephemeralCredLinkScript(homeDir, deps.credentialPaths)}`;
+ const prepare = `mkdir -p ${shq(workspaceDir)}${credLinks}`;
const toolIo = {
exec: (script: string, t: number) => deps.exec(name, script, t),
writeAbs: (abs: string, data: Uint8Array) => deps.writeAbsBytes(name, abs, data),
diff --git a/src/sandbox/local-sandbox.ts b/src/sandbox/local-sandbox.ts
index 4451c81fd..1abb003d6 100644
--- a/src/sandbox/local-sandbox.ts
+++ b/src/sandbox/local-sandbox.ts
@@ -9,7 +9,7 @@ import type { WorkspaceStore } from "../workspace/workspace-store.ts";
import { createKeyedQueue, sleep } from "../util/async.ts";
import { swallowAs, errMessage } from "../util/errors.ts";
import { shq } from "../util/shell.ts";
-import { nonInteractiveShellPrefix, provisionPrepScript } from "./sandbox-env.ts";
+import { nonInteractiveShellPrefix } from "./sandbox-env.ts";
import { createExecProcessSessions, type ExecProcessIo } from "./exec-process-session.ts";
import { materializeRoLayers } from "./ro-layers.ts";
import { createExecExport, createExecFileOps, posixJoin } from "./exec-file-ops.ts";
@@ -404,7 +404,7 @@ export function createLocalSandbox(workspace: WorkspaceStore, opts: LocalSandbox
try {
const prep = await execRaw(
name,
- provisionPrepScript(workspaceDir, ephemeralCredLinkScript(homeDir)),
+ `mkdir -p ${shq(workspaceDir)} && ${ephemeralCredLinkScript(homeDir)}`,
PREP_TIMEOUT_SEC,
);
if (prep.code !== 0)
diff --git a/src/sandbox/managed-agents-sandbox.ts b/src/sandbox/managed-agents-sandbox.ts
index cea46cf94..2c64d0df5 100644
--- a/src/sandbox/managed-agents-sandbox.ts
+++ b/src/sandbox/managed-agents-sandbox.ts
@@ -6,12 +6,7 @@ import type { DurableMap } from "../persistence/durable-map.ts";
import { createKeyedQueue } from "../util/async.ts";
import { swallowAs, errMessage } from "../util/errors.ts";
import { shq } from "../util/shell.ts";
-import {
- nonInteractiveShellPrefix,
- DROPPED_PROXY_ENV,
- forceThroughProxyEnv,
- provisionPrepScript,
-} from "./sandbox-env.ts";
+import { nonInteractiveShellPrefix, DROPPED_PROXY_ENV, forceThroughProxyEnv } from "./sandbox-env.ts";
import { createExecProcessSessions, type ExecProcessIo } from "./exec-process-session.ts";
import { materializeRoLayers } from "./ro-layers.ts";
import { createLayerToolInstaller } from "./layer-tool-install.ts";
@@ -439,8 +434,8 @@ export function createManagedAgentsSandbox(workspace: WorkspaceStore, opts: Mana
};
try {
- const credLinks = scratch ? null : ephemeralCredLinkScript(HOME_DIR, opts.credentialPaths ?? []);
- const prep = await execRaw(name, provisionPrepScript(workspaceDir, credLinks), 60);
+ const credLinks = scratch ? "" : ` && ${ephemeralCredLinkScript(HOME_DIR, opts.credentialPaths ?? [])}`;
+ const prep = await execRaw(name, `mkdir -p ${shq(workspaceDir)}${credLinks}`, 60);
if (prep.code !== 0)
throw new Error(`do-managed-agents provision prep failed: ${(prep.stderr || prep.stdout).slice(0, 200)}`);
diff --git a/src/sandbox/modal-sandbox.ts b/src/sandbox/modal-sandbox.ts
index a78312f88..5dd4e32c3 100644
--- a/src/sandbox/modal-sandbox.ts
+++ b/src/sandbox/modal-sandbox.ts
@@ -8,12 +8,7 @@ import { orgId as configOrgId } from "../config.ts";
import { createKeyedQueue } from "../util/async.ts";
import { swallowAs, errMessage } from "../util/errors.ts";
import { shq } from "../util/shell.ts";
-import {
- nonInteractiveShellPrefix,
- DROPPED_PROXY_ENV,
- forceThroughProxyEnv,
- provisionPrepScript,
-} from "./sandbox-env.ts";
+import { nonInteractiveShellPrefix, DROPPED_PROXY_ENV, forceThroughProxyEnv } from "./sandbox-env.ts";
import { createExecProcessSessions, type ExecProcessIo } from "./exec-process-session.ts";
import { materializeRoLayers } from "./ro-layers.ts";
import { withConnectorSdk, type ConnectorSdkBundle } from "./connector-sdk.ts";
@@ -718,13 +713,13 @@ export function createModalSandbox(workspace: WorkspaceStore, opts: ModalSandbox
};
try {
- const credLinks = scratch ? null : ephemeralCredLinkScript(HOME_DIR, opts.credentialPaths ?? []);
+ const credLinks = scratch ? "" : ` && ${ephemeralCredLinkScript(HOME_DIR, opts.credentialPaths ?? [])}`;
await installLayerTools(
{
exec: (script, t) => execRaw(name, script, t),
writeAbs: (abs, data) => writeAbsBytes(name, abs, data),
},
- provisionPrepScript(workspaceDir, credLinks),
+ `mkdir -p ${shq(workspaceDir)}${credLinks}`,
);
await materializeRoLayers(
diff --git a/src/sandbox/porter-sandbox.ts b/src/sandbox/porter-sandbox.ts
index 48988643f..33631ab36 100644
--- a/src/sandbox/porter-sandbox.ts
+++ b/src/sandbox/porter-sandbox.ts
@@ -19,12 +19,7 @@ import {
type PorterSandboxLike,
} from "./porter-client.ts";
import { shq } from "../util/shell.ts";
-import {
- nonInteractiveShellPrefix,
- DROPPED_PROXY_ENV,
- forceThroughProxyEnv,
- provisionPrepScript,
-} from "./sandbox-env.ts";
+import { nonInteractiveShellPrefix, DROPPED_PROXY_ENV, forceThroughProxyEnv } from "./sandbox-env.ts";
import { createExecProcessSessions, type ExecProcessIo } from "./exec-process-session.ts";
import { materializeRoLayers } from "./ro-layers.ts";
import { createExecExport, createBackendBlobStaging, createExecFileOps, posixJoin } from "./exec-file-ops.ts";
@@ -313,8 +308,8 @@ export function createPorterSandbox(workspace: WorkspaceStore, opts: PorterSandb
};
try {
- const credLinks = scratch ? null : ephemeralCredLinkScript(homeDir, opts.credentialPaths ?? []);
- const prep = await execRaw(name, provisionPrepScript(workspaceDir, credLinks), 60);
+ const credLinks = scratch ? "" : ` && ${ephemeralCredLinkScript(homeDir, opts.credentialPaths ?? [])}`;
+ const prep = await execRaw(name, `mkdir -p ${shq(workspaceDir)}${credLinks}`, 60);
if (prep.code !== 0)
throw new Error(`porter provision prep failed: ${(prep.stderr || prep.stdout).slice(0, 200)}`);
diff --git a/src/sandbox/sandbox-env.ts b/src/sandbox/sandbox-env.ts
index 840337035..e93fff2dd 100644
--- a/src/sandbox/sandbox-env.ts
+++ b/src/sandbox/sandbox-env.ts
@@ -27,18 +27,6 @@ export const DROPPED_PROXY_ENV = new Set([
"NO_PROXY",
]);
-const SUDO_KEPT_ENV = ["DEBIAN_FRONTEND", "GIT_TERMINAL_PROMPT", ...DROPPED_PROXY_ENV, "GIT_HTTP_PROXY_AUTHMETHOD"];
-
-const SUDOERS_KEEP_ENV = shq(`Defaults env_keep += "${SUDO_KEPT_ENV.join(" ")}"`);
-
-const SUDO_KEEPS_ENV =
- `[ ! -d /etc/sudoers.d ] || [ -s /etc/sudoers.d/qm-env ] || ` +
- `printf '%s\\n' ${SUDOERS_KEEP_ENV} | sudo -n sh -c 'umask 337; cat > /etc/sudoers.d/qm-env' 2>/dev/null || true`;
-
-export function provisionPrepScript(workspaceDir: string, credLinks: string | null): string {
- return `mkdir -p ${shq(workspaceDir)}${credLinks ? ` && ${credLinks}` : ""} && { ${SUDO_KEEPS_ENV}; }`;
-}
-
export function forceThroughProxyEnv(
egressProxyUrl: string,
token: string,
diff --git a/src/sandbox/superserve-sandbox.ts b/src/sandbox/superserve-sandbox.ts
index 4affdd87d..cd40e5c80 100644
--- a/src/sandbox/superserve-sandbox.ts
+++ b/src/sandbox/superserve-sandbox.ts
@@ -8,7 +8,7 @@ import type { AdvisoryLock } from "../persistence/advisory-lock.ts";
import { createKeyedQueue } from "../util/async.ts";
import { swallowAs, errMessage } from "../util/errors.ts";
import { shq } from "../util/shell.ts";
-import { nonInteractiveShellPrefix, DROPPED_PROXY_ENV, provisionPrepScript } from "./sandbox-env.ts";
+import { nonInteractiveShellPrefix, DROPPED_PROXY_ENV } from "./sandbox-env.ts";
import { createExecProcessSessions, type ExecProcessIo } from "./exec-process-session.ts";
import { materializeRoLayers } from "./ro-layers.ts";
import { createLayerToolInstaller } from "./layer-tool-install.ts";
@@ -587,8 +587,8 @@ export function createSuperserveSandbox(workspace: WorkspaceStore, opts: Superse
const prepare = async (): Promise<SandboxHandle> => {
assertCurrent(handle);
if (!(await ownsGuest(name))) return handle;
- const credLinks = scratch ? null : ephemeralCredLinkScript(homeDir, opts.credentialPaths ?? []);
- const prep = await execRaw(name, provisionPrepScript(workspaceDir, credLinks), PREP_TIMEOUT_SEC);
+ const credLinks = scratch ? "" : ` && ${ephemeralCredLinkScript(homeDir, opts.credentialPaths ?? [])}`;
+ const prep = await execRaw(name, `mkdir -p ${shq(workspaceDir)}${credLinks}`, PREP_TIMEOUT_SEC);
if (prep.code !== 0)
throw new Error(`superserve provision prep failed: ${(prep.stderr || prep.stdout).slice(0, 200)}`);
await materializeRoLayers(
diff --git a/test/local-sandbox.test.ts b/test/local-sandbox.test.ts
index 15c36e7e5..92bb43e0a 100644
--- a/test/local-sandbox.test.ts
+++ b/test/local-sandbox.test.ts
@@ -1,7 +1,7 @@
import { test, before, after } from "node:test";
import assert from "node:assert/strict";
import { spawn, type ChildProcess } from "node:child_process";
-import { mkdtempSync, writeFileSync } from "node:fs";
+import { mkdtempSync } from "node:fs";
import { createServer, type AddressInfo } from "node:net";
import { tmpdir } from "node:os";
import { join } from "node:path";
@@ -32,21 +32,10 @@ async function freePort(): Promise<number> {
});
}
-function refusingSudoDir(): string {
- const bin = mkdtempSync(join(tmpdir(), "refusing-sudo-"));
- writeFileSync(join(bin, "sudo"), "#!/bin/sh\nexit 1\n", { mode: 0o755 });
- return bin;
-}
-
before(async () => {
daemonPort = await freePort();
daemon = spawn(process.execPath, [join(process.cwd(), "cli/templates/aws/microvm-agent/agent.mjs")], {
- env: {
- ...process.env,
- AGENT_PORT: String(daemonPort),
- HOME: guestHome,
- PATH: `${refusingSudoDir()}:${process.env.PATH}`,
- },
+ env: { ...process.env, AGENT_PORT: String(daemonPort), HOME: guestHome },
stdio: "ignore",
});
const deadline = Date.now() + 10_000;
diff --git a/test/sandbox-noninteractive.test.ts b/test/sandbox-noninteractive.test.ts
index 6372fdda9..25301aef3 100644
--- a/test/sandbox-noninteractive.test.ts
+++ b/test/sandbox-noninteractive.test.ts
@@ -1,6 +1,6 @@
import { test, before, after } from "node:test";
import assert from "node:assert/strict";
-import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, writeFileSync } from "node:fs";
+import { mkdtempSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { createSpritesSandbox } from "../src/sandbox/sprites-sandbox.ts";
@@ -63,25 +63,3 @@ test("an explicit per-turn env value wins over the non-interactive default", asy
const r = await sandbox.run(handle, 'printf "%s" "$PAGER"');
assert.equal(r.stdout, "less");
});
-
-test("provisioning installs a sudoers env_keep entry so sudo keeps the proxy and non-interactive env", async () => {
- const bin = mkdtempSync(join(tmpdir(), "nopass-sudo-"));
- writeFileSync(join(bin, "sudo"), '#!/bin/sh\nwhile [ "${1#-}" != "$1" ]; do shift; done\nexec "$@"\n');
- chmodSync(join(bin, "sudo"), 0o755);
- const path = process.env.PATH;
- process.env.PATH = `${bin}:${path}`;
- try {
- const { sandbox, layers } = spritesHandle();
- const first = await sandbox.provision(layers);
- const sudoersDir = join(ff.homeDir(first.id), ".etc-sudoers.d");
- assert.equal(existsSync(sudoersDir), false);
- mkdirSync(sudoersDir);
- await sandbox.provision(layers);
- assert.equal(
- readFileSync(join(sudoersDir, "qm-env"), "utf8"),
- 'Defaults env_keep += "DEBIAN_FRONTEND GIT_TERMINAL_PROMPT http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY all_proxy no_proxy NO_PROXY GIT_HTTP_PROXY_AUTHMETHOD"\n',
- );
- } finally {
- process.env.PATH = path;
- }
-});
diff --git a/test/support/fake-agent37.ts b/test/support/fake-agent37.ts
index 124464d9d..2c7e883e8 100644
--- a/test/support/fake-agent37.ts
+++ b/test/support/fake-agent37.ts
@@ -94,7 +94,6 @@ export function installFakeAgent37(): FakeAgent37 {
script
.replace(/\btimeout (?:-k \d+ )?\d+ /g, "")
.replace(/\/home\/node/g, m.home)
- .replaceAll("/etc/sudoers.d", `${m.home}/.etc-sudoers.d`)
.replace(remapPath, (mm) => (mm.startsWith(m.home) ? mm : `${m.home}/tmp/`))
);
};
diff --git a/test/support/fake-e2b.ts b/test/support/fake-e2b.ts
index 1e5a1b506..4c0d5850a 100644
--- a/test/support/fake-e2b.ts
+++ b/test/support/fake-e2b.ts
@@ -67,7 +67,6 @@ export function installFakeE2b(fakeOpts: { info?: boolean } = {}): FakeE2b {
script
.replace(/\btimeout \d+ /g, "")
.replace(/\/home\/user/g, r.home)
- .replaceAll("/etc/sudoers.d", `${r.home}/.etc-sudoers.d`)
.replace(remapPath, (mm) => (mm.startsWith(r.home) ? mm : `${r.home}/tmp/`))
);
};
diff --git a/test/support/fake-managed-agents.ts b/test/support/fake-managed-agents.ts
index 086e16b46..807d8a031 100644
--- a/test/support/fake-managed-agents.ts
+++ b/test/support/fake-managed-agents.ts
@@ -100,7 +100,6 @@ export function installFakeManagedAgents(): FakeManagedAgents {
script
.replace(/\btimeout \d+ /g, "")
.replace(GUEST_ROOT_PREFIX, r.guestRoot)
- .replaceAll("/etc/sudoers.d", `${r.guestRoot}/.etc-sudoers.d`)
.replace(remapPath, (mm) => (mm.startsWith(r.guestRoot) ? mm : `${r.guestRoot}/tmp/`))
);
};
diff --git a/test/support/fake-modal.ts b/test/support/fake-modal.ts
index a79695703..768740bf4 100644
--- a/test/support/fake-modal.ts
+++ b/test/support/fake-modal.ts
@@ -56,7 +56,6 @@ export function installFakeModal(opts: { native?: boolean } = {}): FakeModal {
script
.replace(/\btimeout \d+ /g, "")
.replace(/\/root(?![A-Za-z0-9_-])/g, r.home)
- .replaceAll("/etc/sudoers.d", `${r.home}/.etc-sudoers.d`)
.replace(remapPath, (mm) => (mm.startsWith(r.home) ? mm : `${r.home}/tmp/`))
);
};
diff --git a/test/support/fake-porter.ts b/test/support/fake-porter.ts
index b11c57e4f..7df4446b6 100644
--- a/test/support/fake-porter.ts
+++ b/test/support/fake-porter.ts
@@ -83,7 +83,6 @@ export function installFakePorter(opts: FakePorterOptions = {}): FakePorter {
let out = script
.replace(/\btimeout (?:-k \d+ )?\d+ /g, "")
.replace(remapTmp, `${b.tmp}/`)
- .replaceAll("/etc/sudoers.d", `${b.home}/.etc-sudoers.d`)
.replace(pathRe(GUEST_HOME), b.home)
.replace(pathRe(GUEST_APP), b.app);
for (const [guest, dir] of Object.entries(b.mounts))
diff --git a/test/support/fake-smolmachines.ts b/test/support/fake-smolmachines.ts
index 612ce8181..2abf25bb0 100644
--- a/test/support/fake-smolmachines.ts
+++ b/test/support/fake-smolmachines.ts
@@ -105,7 +105,6 @@ export function installFakeSmolmachines(): FakeSmolmachines {
script
.replace(/\btimeout \d+ /g, "")
.replace(/\/root/g, m.home)
- .replaceAll("/etc/sudoers.d", `${m.home}/.etc-sudoers.d`)
.replace(remapPath, (mm) => (mm.startsWith(m.home) ? mm : `${m.home}/tmp/`))
);
};
diff --git a/test/support/fake-sprites.ts b/test/support/fake-sprites.ts
index 609c36c85..acf108399 100644
--- a/test/support/fake-sprites.ts
+++ b/test/support/fake-sprites.ts
@@ -213,7 +213,6 @@ export function installFakeSprites(origin = `https://fake-sprites-${++nextOrigin
.replace(/\/proc\/pressure\/io/g, `${home}/.proc-pressure-io`)
.replace(/\/proc\/loadavg/g, `${home}/.proc-loadavg`)
.replace(/\/usr\/local/g, `${home}/.usr-local`)
- .replaceAll("/etc/sudoers.d", `${home}/.etc-sudoers.d`)
.replace(/\/home\/sprite/g, home)
.replace(remapPath, (m) => (m.startsWith(home) ? m : `${home}/tmp/`))
);
diff --git a/test/support/fake-superserve.ts b/test/support/fake-superserve.ts
index 55b689d43..01ac682a2 100644
--- a/test/support/fake-superserve.ts
+++ b/test/support/fake-superserve.ts
@@ -81,7 +81,6 @@ export function installFakeSuperserve(): FakeSuperserve {
const remap = (r: FakeRecord, script: string): string =>
script
.replace(/\btimeout (?:-k \d+ )?\d+ /g, "")
- .replaceAll("/etc/sudoers.d", `${r.home}/.etc-sudoers.d`)
.replace(/(^|[^A-Za-z0-9._/-])\/tmp\//g, `$1${r.home}/tmp/`)
.replace(/(^|[^A-Za-z0-9._/-])\/root(?=\/|$|[^A-Za-z0-9._/-])/g, `$1${r.home}`);