From c7afd1ea752aeff0310ac7c6b78d091ac360c760 Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 15 Nov 2026 15:38:57 +0100 Subject: 0.4.3: kill process groups, bound bash output, keep the key out of tool env - setsid-style process group kill on timeout and on Ctrl-C - 64 MiB RLIMIT_FSIZE so a runaway command cannot fill /tmp - OPENCODE_API_KEY removed from child environment - sessions 0600/0700, history 0600 and trimmed --- src/doctor.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/doctor.rs') diff --git a/src/doctor.rs b/src/doctor.rs index 42d24a8..65fca50 100644 --- a/src/doctor.rs +++ b/src/doctor.rs @@ -19,7 +19,20 @@ pub fn run(cfg: &Config) -> i32 { match config::key_source() { KeySource::Env => row(true, "key", "present in OPENCODE_API_KEY"), - KeySource::File(path) => row(true, "key", &format!("present in {}", path.display())), + KeySource::File(path) => { + row(true, "key", &format!("present in {}", path.display())); + use std::os::unix::fs::PermissionsExt; + if let Ok(meta) = std::fs::metadata(&path) { + if meta.permissions().mode() & 0o077 != 0 { + println!( + "{:<13} {:<4} {} is readable by other users; chmod 600 it", + "key perms", + "WARN", + path.display() + ); + } + } + } KeySource::Missing => { row( false, -- cgit v1.2.3