From 683e2128a5d00bcadea7cc2f71a48253032632a5 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Dec 2026 00:51:48 +0000 Subject: enstate: the state directory is root's The receptor makes the state directory 0700 whoever created it (a deploy copying into incoming/, say), and the module has tmpfiles keep it so. --- tests/migrations.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/migrations.rs b/tests/migrations.rs index 05e3099..e66895c 100644 --- a/tests/migrations.rs +++ b/tests/migrations.rs @@ -370,6 +370,13 @@ fn incoming_submissions() { assert_eq!(host.view("a", "a").unwrap(), b"A"); assert!(host.snapshot("secrets").is_some()); assert!(!host.root.join("state/incoming/1").exists()); + // The deploy created the state directory, readable by all; it is root's now. + use std::os::unix::fs::PermissionsExt; + let mode = std::fs::metadata(host.root.join("state")) + .unwrap() + .permissions() + .mode(); + assert_eq!(mode & 0o777, 0o700); // Two in order, the second building on what the first makes; then one refused, // which refuses the switch, and is moved aside by it. -- cgit v1.3.1