import fs from "node:fs"; import path from "node:path";
// Keep defaults to OS-managed immutable bins only. // User/package-manager bins must be opted in via tools.exec.safeBinTrustedDirs. const DEFAULT_SAFE_BIN_TRUSTED_DIRS = ["/bin", "/usr/bin"];
export function listWritableExplicitTrustedSafeBinDirs(
entries?: readonly string[] | null,
): WritableTrustedSafeBinDir[] { if (process.platform === "win32") { return [];
} const resolved = resolveTrustedSafeBinDirs(normalizeTrustedSafeBinDirs(entries)); const hits: WritableTrustedSafeBinDir[] = []; for (const dir of resolved) {
let stat: fs.Stats; try {
stat = fs.statSync(dir);
} catch { continue;
} if (!stat.isDirectory()) { continue;
} const mode = stat.mode & 0o777; const groupWritable = (mode & 0o020) !== 0; const worldWritable = (mode & 0o002) !== 0; if (!groupWritable && !worldWritable) { continue;
}
hits.push({ dir, groupWritable, worldWritable });
} return hits;
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.14Bemerkung:
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.