From 58c753429f299d10fd60303d10ca085863ce3717 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 12 May 2022 16:36:28 +0100 Subject: [PATCH] arti-bench: Disable all fs permissions (fs-mistrust) checks This is a benchmarking tool, and fs-mistrust doesn't like the permissions in our CI. The env var ARTI_FS_DISABLE_PERMISSION_CHECKS is (of course) specific to arti. Maybe it should be honoured here, or this should be done via the config files. But disabling this is fine for now. --- Cargo.lock | 1 + crates/arti-bench/Cargo.toml | 1 + crates/arti-bench/src/main.rs | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index c87ff5995..3d7a19a83 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -113,6 +113,7 @@ dependencies = [ "arti-config", "clap", "float-ord", + "fs-mistrust", "futures", "rand 0.8.5", "serde", diff --git a/crates/arti-bench/Cargo.toml b/crates/arti-bench/Cargo.toml index 8f87925fc..9333d0caf 100644 --- a/crates/arti-bench/Cargo.toml +++ b/crates/arti-bench/Cargo.toml @@ -26,4 +26,5 @@ tor-rtcompat = { path = "../tor-rtcompat", version = "0.3.0", features = ["tokio arti = { path = "../arti", version = "0.3.0"} arti-config = { path = "../arti-config", version = "0.3.0"} arti-client = { package = "arti-client", path = "../arti-client", version = "0.3.0"} +fs-mistrust = { path = "../fs-mistrust", version = "0.1.0" } tokio-socks = "0.5" diff --git a/crates/arti-bench/src/main.rs b/crates/arti-bench/src/main.rs index 8a59fea73..4ddd521cd 100644 --- a/crates/arti-bench/src/main.rs +++ b/crates/arti-bench/src/main.rs @@ -359,6 +359,13 @@ fn main() -> Result<()> { .values_of_os("arti-config") .unwrap_or_default() .for_each(|f| config_sources.push_file(f)); + + // TODO really we ought to get this from the arti configuration, or something. + // But this is OK for now since we are a benchmarking tool. + let mut mistrust = fs_mistrust::Mistrust::new(); + mistrust.dangerously_trust_everyone(); + config_sources.set_mistrust(mistrust); + let cfg = config_sources.load()?; let config: ArtiConfig = cfg.try_into()?; let tcc = config.tor_client_config()?;