fix sandbox HOME resolution — capture at module load before user-instance overrides it
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ const BUN_DIR = (() => {
|
|||||||
|
|
||||||
const PROJECT_ROOT = resolve(import.meta.dir, '../../..');
|
const PROJECT_ROOT = resolve(import.meta.dir, '../../..');
|
||||||
const DATA_PATH = process.env.DATA_PATH ?? join(process.cwd(), 'data');
|
const DATA_PATH = process.env.DATA_PATH ?? join(process.cwd(), 'data');
|
||||||
|
const HOST_HOME = process.env.HOME!;
|
||||||
|
|
||||||
// Resolve the OS username for runuser to drop privileges inside the sandbox
|
// Resolve the OS username for runuser to drop privileges inside the sandbox
|
||||||
const OS_USERNAME = (() => {
|
const OS_USERNAME = (() => {
|
||||||
@@ -72,7 +73,7 @@ export function buildSandboxPrefix(email: string): string[] {
|
|||||||
|
|
||||||
// Ensure intermediate dirs under HOME are traversable after runuser drops privileges
|
// Ensure intermediate dirs under HOME are traversable after runuser drops privileges
|
||||||
// (bwrap auto-creates them as root-owned drwx------)
|
// (bwrap auto-creates them as root-owned drwx------)
|
||||||
const homeDir = process.env.HOME!;
|
const homeDir = HOST_HOME;
|
||||||
args.push('--perms', '0755', '--dir', homeDir);
|
args.push('--perms', '0755', '--dir', homeDir);
|
||||||
|
|
||||||
// Bun runtime (e.g. /home/pastilhas/.bun)
|
// Bun runtime (e.g. /home/pastilhas/.bun)
|
||||||
|
|||||||
Reference in New Issue
Block a user