From 70b7dd15e579a459cb0c2c2cb5690f78543ca5bc Mon Sep 17 00:00:00 2001 From: Archipelago Date: Fri, 13 Nov 2026 17:09:23 +0300 Subject: [PATCH] Self-check: any packaged usr/bin file is an executable The console onboarding wrapper needs 0755 to be started by agetty; the manifest check hardcoded 644 for everything except the CLI binary. --- src/self_check.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/self_check.rs b/src/self_check.rs index 6aeefce..19c6793 100644 --- a/src/self_check.rs +++ b/src/self_check.rs @@ -43,7 +43,11 @@ pub fn check() -> Result<(), String> { } let path = format!("/{}", fields[3]); let metadata = fs::symlink_metadata(&path).map_err(|e| format!("{path}: {e}"))?; - let expected = if path == "/usr/bin/archipelago" { binary_seen = true; "755" } else { "644" }; + if path == "/usr/bin/archipelago" { binary_seen = true; } + // Executables live in usr/bin; everything else is data and must not be + // executable. The console onboarding wrapper is run by agetty, so it is + // a packaged executable like the CLI itself. + let expected = if fields[3].starts_with("usr/bin/") { "755" } else { "644" }; if fields[0] != expected || fields[1] != "0" || fields[2] != "0" || !metadata.is_file() || metadata.uid() != 0 || metadata.gid() != 0 || format!("{:o}", metadata.mode() & 0o7777) != expected {