mind-body: directories the writer creates are 0755 ancestors included; the probe reports its sweeps

Under the binary's umask 077 a first write would have left /etc/gamecult/minds
0700 and unreadable by the units. The attacker reports how much it swept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-09 16:43:59 +02:00
commit eb8aefc0fb
2 changed files with 38 additions and 1 deletions

View file

@ -1,4 +1,13 @@
//! The operator's brake and burn-rate dial, and the one reader of them.
// Every directory this write creates is 0755, ancestors included: a
// restrictive process umask would otherwise leave /etc/gamecult/minds
// untraversable by the units that only read.
let missing: Vec<&Path> = directory.ancestors().take_while(|ancestor| !ancestor.exists()).collect();
if !missing.is_empty() {
std::fs::create_dir_all(directory).with_context(|| format!("failed to create {}", directory.display()))?;
for created in missing {
set_mode(created, DIR_MODE)?;
}
}//! The operator's brake and burn-rate dial, and the one reader of them.
//!
//! State is a CultCache single-file store at
//! `/etc/gamecult/minds/<instance>/control.cc`, root-owned and world-readable.