Files
sausage/spikes/s4-builder/fixture/build.rs
T
surma 9e9cde5241 spikes: six v3 spikes (V8 harness, WASI shell, git, builder, http hook, esbuild)
Throwaway prototypes for Sausage v3. Plan and decisions:
~/research/sausage-v3/PLAN.md. Results and evidence: the spike READMEs.
2026-11-06 14:03:20 +00:00

18 lines
688 B
Rust

//! Asserts that native build scripts cannot access host files or the network.
use std::{
env, fs,
net::{SocketAddr, TcpStream},
time::Duration,
};
fn main() {
let home = env::var("HOME").unwrap();
assert!(fs::read_dir(format!("{home}/.ssh")).is_err());
assert!(fs::read_dir("/home/surma/.ssh").is_err());
assert!(fs::write("/outside-target-probe", "escape").is_err());
let address: SocketAddr = "1.1.1.1:443".parse().unwrap();
assert!(TcpStream::connect_timeout(&address, Duration::from_secs(1)).is_err());
println!("cargo:warning=PASS: HOME/.ssh hidden, outside write denied, network denied");
println!("cargo:rerun-if-changed=build.rs");
}