Commits the 5 product paths and 7 gate helpers of the row 227 R4 source overlay on top of HEAD 5a0c801cb. scripts/case2/console.mjs is already committed at HEAD and is not part of this commit. The R4 independent review is sha256 6667baaa6af9d6d78a3ec7c64d9f3163ecbc350b94050f62899d9c01deabe002, verdict APPROVE source-only. Packet hashes: PACKET.sha256 4eb60915b2144137df9b5a42afd0c5b266718d71de051fb8be53a27430a2cad4, CURRENT-SOURCE.sha256 0cfd47c2073bc18a3ba7bff1ce6fdf39fe33a64b7fca209be71517b9feb89020. The 12 committed files match the review hash table, the applied overlay JSON (size, mode, hash) and the saved overlay tar. No scripts/test-case2.sh run exists on these bytes.
25 lines
1.6 KiB
Python
25 lines
1.6 KiB
Python
#!/usr/bin/python3
|
|
# Existing createLauncher bwrap test seam only: original sandbox args/mount policy retained.
|
|
import os,sys,json,time
|
|
from pathlib import Path
|
|
control=Path(sys.argv[1]).resolve(); preload=Path(sys.argv[2]).resolve(); args=sys.argv[3:]
|
|
if not control.is_dir() or not preload.is_file(): raise RuntimeError('native-wrapper-input')
|
|
os.setpriority(os.PRIO_PROCESS,0,19)
|
|
if os.getpriority(os.PRIO_PROCESS,0)!=19: raise RuntimeError('native-wrapper-priority')
|
|
config=json.loads((control/'control.json').read_text())
|
|
# sandboxProblem's true probe has no runner effects; it retains the real bwrap probe unchanged.
|
|
if len(args)>=3 and args[-2].endswith('/packages/harness/src/runner.mjs'):
|
|
run=Path(args[-1]).resolve()
|
|
if not run.is_relative_to(Path(config['private']).resolve()): raise RuntimeError('native-run-outside-owned-root')
|
|
directory=run/'.row227-native'; directory.mkdir(mode=0o700)
|
|
(run/'.row227-native-control.json').write_text(json.dumps(config)+'\n');os.chmod(run/'.row227-native-control.json',0o600)
|
|
stat=Path('/proc/self/stat').read_text();start=stat[stat.rfind(')')+2:].split()[19]
|
|
row=dict(version=1,nonce=config['nonce'],wrapperPid=os.getpid(),wrapperStart=start,run=str(run))
|
|
pending=control/'launches'/f'{os.getpid()}-{start}.pending'
|
|
with pending.open('x') as f: json.dump(row,f)
|
|
os.chmod(pending,0o600);pending.rename(pending.with_suffix('.json'))
|
|
# Invocation-only sandbox environment preserves isRunner's exact node/runner argv identity.
|
|
separator=args.index('--')
|
|
args=args[:separator]+['--setenv','NODE_OPTIONS','--import='+str(preload)]+args[separator:]
|
|
os.execv('/usr/bin/bwrap',['/usr/bin/bwrap',*args])
|