Validate complete engine addresses and retain shared socket inputs (#503)
This commit is contained in:
parent
97ce77d3de
commit
4a87fc2c7d
@@ -6,6 +6,8 @@ import { constants } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join, dirname } from "node:path";
|
||||
|
||||
import { checkedSocketPath } from "../socket-address.mjs";
|
||||
|
||||
const abi = "quixos-transaction-ports-v1";
|
||||
/** Reserved supervisor faults are not authored domain rejections. A graph
|
||||
* transaction must roll back without recording a permanent rejected outcome
|
||||
@@ -359,10 +361,16 @@ export async function serveRestrictedRegistry(config, io = process) {
|
||||
() => destroyEngine(engine),
|
||||
);
|
||||
if (!call.open) return;
|
||||
if (config.sandboxIdentity) {
|
||||
// The privileged helper owns a fixed explicit /run root and requires
|
||||
// this exact basename. Keep its cross-UID ancestry and identity rules.
|
||||
for (const filename of ["broker.sock", "engine.sock"])
|
||||
checkedSocketPath(tmpdir() + "/qx-engine-XXXXXX/" + filename);
|
||||
}
|
||||
engine.directory = await mkdtemp(join(tmpdir(), "qx-engine-"));
|
||||
if (!call.open) return;
|
||||
const broker = join(engine.directory, "broker.sock");
|
||||
engine.socket = join(engine.directory, "engine.sock");
|
||||
const broker = checkedSocketPath(join(engine.directory, "broker.sock"));
|
||||
engine.socket = checkedSocketPath(join(engine.directory, "engine.sock"));
|
||||
engine.server = createServer(async (request, response) => {
|
||||
const call = engine.current;
|
||||
const message = call?.message;
|
||||
|
||||
Reference in New Issue
Block a user