Sidecar leak check: skip a generic build home (/root in a CI container is a substring of the bun runtime itself); privacy-scan still checks every home

This commit is contained in:
CRTkafa 2026-10-10 21:38:41 +00:00
parent d813cf1dbd
commit c4d596fe8a
2 changed files with 12 additions and 3 deletions

View file

@ -32,9 +32,13 @@ export function hostTarget(): string {
export const outName = (target: string): string => `storebound-${TARGETS[target]}${target.includes('windows') ? '.exe' : ''}`;
/** Home folders of build accounts that name nobody (a CI container runs as root). They are not searched for: "/root"
* is a substring of the bun runtime itself (root_certs.cpp, ICU's root.res). privacy-scan still checks every home. */
export const GENERIC_HOME = /^(\/root|\/home\/(runner|ubuntu|build|builder|ci|docker|node|user))\/?$/;
/** Paths of this machine that must not appear in a shipped binary. */
export function privateStrings(): string[] {
return [...new Set([homedir(), ROOT].filter(s => s.length > 4))];
export function privateStrings(home = homedir(), root = ROOT): string[] {
return [...new Set([GENERIC_HOME.test(home) ? '' : home, root].filter(s => s.length > 4))];
}
export function leaks(file: string, needles = privateStrings()): string[] {