Revert "fix: canonicalize the writeable paths used in seatbelt policy… (#370)
This reverts commit 3356ac0aef.
related #330
This commit is contained in:
@@ -3,7 +3,6 @@ import type { SpawnOptions } from "child_process";
|
|||||||
|
|
||||||
import { exec } from "./raw-exec.js";
|
import { exec } from "./raw-exec.js";
|
||||||
import { log } from "../log.js";
|
import { log } from "../log.js";
|
||||||
import { realpathSync } from "fs";
|
|
||||||
import { CONFIG_DIR } from "src/utils/config.js";
|
import { CONFIG_DIR } from "src/utils/config.js";
|
||||||
|
|
||||||
function getCommonRoots() {
|
function getCommonRoots() {
|
||||||
@@ -30,9 +29,7 @@ export function execWithSeatbelt(
|
|||||||
const { policies, params } = writableRoots
|
const { policies, params } = writableRoots
|
||||||
.map((root, index) => ({
|
.map((root, index) => ({
|
||||||
policy: `(subpath (param "WRITABLE_ROOT_${index}"))`,
|
policy: `(subpath (param "WRITABLE_ROOT_${index}"))`,
|
||||||
// the kernel resolves symlinks before handing them to seatbelt for checking
|
param: `-DWRITABLE_ROOT_${index}=${root}`,
|
||||||
// so store the canonicalized form in the policy to be compared against
|
|
||||||
param: `-DWRITABLE_ROOT_${index}=${realpathSync(root)}`,
|
|
||||||
}))
|
}))
|
||||||
.reduce(
|
.reduce(
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user