From 65f2ec12c123610e3640b123d653cf020fc1d460 Mon Sep 17 00:00:00 2001 From: japabu Date: Wed, 11 Nov 2026 01:21:34 +0200 Subject: [PATCH 1/4] Only the installer's view writes /apps Every declared row saw /apps read-write, so a shell and everything it spawned could rewrite an installed package. A row's view now holds /apps read-only unless the row declares `installs = true`, which in the image is pkg's alone (owner ruling, 2026-11-05: only the installer service writes /apps). pkg is that service, not a client of one. A launch already gives a row its own view, and who may launch pkg is the `starts` that list it, so the whole authority is in images/system.toml and nothing new runs: no port, protocol or daemon. `launch pkg install ` installs; a pkg spawned as a helper holds its parent's view, lists, and refuses install and remove by name. app_view's job writes its packages under /apps itself, so test-runner's row is that image's installer, and the job gains the exit's first arm: a shell's redirect into /tmp writes and into a package is refused. hosted_clang_hello launches pkg. Co-Authored-By: Claude Fable 5.2 --- build/build.rs | 28 ++++++++ images/system.toml | 13 ++-- ...der-apps-and-the-installer-is-a-program.md | 10 +-- ...rogram-sees-only-the-files-it-was-given.md | 23 +++++-- ...-runs-only-what-no-cheaper-tier-reaches.md | 2 +- lib/manifest/src/lib.rs | 67 ++++++++++++++----- lib/manifest/src/package.rs | 4 +- system/pkg/src/main.rs | 22 ++++-- tests/guest/rust-tests/src/bin/app_view.rs | 31 ++++++++- .../rust-tests/src/bin/hosted_clang_hello.rs | 7 +- tests/images/hostedclangcase.toml | 7 +- tests/images/proctreecase.toml | 3 + 12 files changed, 172 insertions(+), 45 deletions(-) diff --git a/build/build.rs b/build/build.rs index e7830d06881..cef9bbbab51 100644 --- a/build/build.rs +++ b/build/build.rs @@ -208,6 +208,9 @@ struct ProgramConfig { /// and puts it in its view beside the session's `HOME`. A service's is /// implied. No row's view holds another's (`toyos_manifest::Program::view`). state: bool, + /// The installer: `/apps` is read-write in its view and read-only in + /// every other row's (`toyos_manifest::Program::installs`). + installs: bool, /// The file-server roles this binary serves, one process each /// (`toyos_manifest::Program::roles`). roles: Vec, @@ -918,6 +921,7 @@ fn render_manifest(config: &SystemConfig) -> Vec { authorize: cfg.authorize.clone(), service: cfg.service, state: cfg.state, + installs: cfg.installs, roles: cfg.roles.clone(), restart: cfg.restart, pager: cfg.pager, @@ -3340,6 +3344,30 @@ mod tests { } } + /// **Only the installer's view holds `/apps` read-write**: `pkg` in the + /// shipped image, and in no config a shell or a row a shell spawns. A + /// test image's writer is the row its job installs through. + #[test] + fn only_the_installer_s_view_writes_apps() { + let root = Path::new(env!("CARGO_MANIFEST_DIR")); + for config in ALL_CONFIGS { + let rendered = render_manifest(&parse_config(&root.join(config))); + let manifest = toyos_manifest::parse(std::str::from_utf8(&rendered).unwrap()); + let writers: Vec<&str> = manifest + .programs + .iter() + .filter(|row| row.view().iter().any(|v| v.dir == toyos_manifest::package::DIR && v.write)) + .map(|row| row.name.as_str()) + .collect(); + let installers: &[&str] = match *config { + "images/system.toml" | "tests/images/hostedclangcase.toml" => &["pkg"], + "tests/images/proctreecase.toml" => &["test-runner"], + _ => &[], + }; + assert_eq!(writers, installers, "{config}"); + } + } + /// One prefix and no other, so a doc naming `/etc/logkeeper` or `/apps/logkeeper` is a /// token the filter below drops and an assertion that reds. const LOG_DOC_BIN: &str = "/system/bin/"; diff --git a/images/system.toml b/images/system.toml index 71ad6532f05..84566fbe54e 100644 --- a/images/system.toml +++ b/images/system.toml @@ -32,9 +32,9 @@ memory-floor-mib = 96 start = ["logkeeper", "uart", "diskserver", "fileserver", "compositor", "soundserver", "netstack", "filepicker", "acpiserver", "ps2server", "wlan", "vdagent"] # What every program launched out of `/apps` holds, whatever its own directory -# says. A package is unpacked by `/system/bin/pkg` into a writable directory, so -# a row read out of one would be a directory deciding what the machine hands -# out; this is the image's answer, one for all of them. Connectors only — +# says. A package is what an archive carried, so a row read out of one would +# be a directory deciding what the machine hands out; this is the image's +# answer, one for all of them. Connectors only — # `devices` and `syscap` have no spelling here, so nothing installed claims # hardware or enters the RT band — and no directory: a package sees its own # `/apps/` read-only and its own `/home/toy/Apps/`, its `HOME`. @@ -52,10 +52,13 @@ folder = "read-write" # with the session user's home, and `state = true` gives it a `/state/` # beside it. No row's view holds any other part of `/state`. [programs] -# The installer. It writes under `/apps` because `/apps` is writable to it. +# The installer: `installs = true` makes `/apps` read-write in its view, and +# it is read-only in every other row's, so `launch pkg install ` installs +# and a shell, or a `pkg` it spawns as a helper, changes no package. Who may +# install is the `starts` that list it. # `/state/pkg` is where the machine's copy of the repository metadata it last # accepted belongs (`toyos_update::repo::Holder::Machine`). -pkg = { state = true } +pkg = { state = true, installs = true } # **Every image that carries a `TOYOS-LOG` partition runs this**, and every # image does. The kernel keeps the record ring, writes the console only before diff --git a/issues/a-package-is-a-directory-under-apps-and-the-installer-is-a-program.md b/issues/a-package-is-a-directory-under-apps-and-the-installer-is-a-program.md index a04b61768e5..880181caec9 100644 --- a/issues/a-package-is-a-directory-under-apps-and-the-installer-is-a-program.md +++ b/issues/a-package-is-a-directory-under-apps-and-the-installer-is-a-program.md @@ -37,9 +37,11 @@ the binary in a ToyOS guest is this track's harness's job, not gbae's. stay for crates, `rust/` and LLVM. Recipes and patches live in this repository, where `NOTICE` and the licence gate carry them, not in a ports repository. -- **The installer** is `/system/bin/pkg`. Who may write `/apps` (owner - ruling, 2026-11-05) is staged in stage 2 of - `issues/every-program-sees-only-the-files-it-was-given.md`. `pkg` +- **The installer** is `/system/bin/pkg`, and only its row's view holds + `/apps` read-write (owner ruling, 2026-11-05; stage 2 of + `issues/every-program-sees-only-the-files-it-was-given.md`): it installs + and removes launched, `launch pkg install `, and a `pkg` spawned as + a helper lists and refuses the rest by name. `pkg` fetches, verifies, unpacks and commits, and it asks the user before it installs — at install, the moment the user typed the command, never at first run, so a refusal leaves nothing on disk and no answer has @@ -72,7 +74,7 @@ The storage track's users and mount-protocol stages do not block this one. `issues/the-guest-suite-runs-only-what-no-cheaper-tier-reaches.md` owes. **What a package holds is the image's `[apps]` row, never its own `manifest.toml`** — that file names which of the directory's - binaries a launch starts and nothing else, so a writable `/apps` cannot name + binaries a launch starts and nothing else, so no file under `/apps` can name a device or a right. The stage-then-commit above amends it: `pkg` writes `/apps//` in place today, its `manifest.toml` last (`system/pkg/src/main.rs`). It streams an archive of any size that fits diff --git a/issues/every-program-sees-only-the-files-it-was-given.md b/issues/every-program-sees-only-the-files-it-was-given.md index cfb1edc80c5..66d668d0c89 100644 --- a/issues/every-program-sees-only-the-files-it-was-given.md +++ b/issues/every-program-sees-only-the-files-it-was-given.md @@ -66,14 +66,23 @@ other, with the same per-session isolation (owner, 2026-11-05). the whole tree, `/system` read-only and the rest read-write but `/state`, of which each row holds only its own directory where it keeps state (`service = true` or `state = true`: the daemons' own state is built). - `/apps` is included, so a shell and everything it starts can - rewrite an installed package. Only the installer service writes `/apps` - (owner ruling, 2026-11-05): this stage gives that one row `/apps` - read-write and every other row, the shell included, - `/apps` read-only. Whether `pkg` becomes that service or its client is - this stage's brief. **Its exit**: a shell's write under `/apps` is refused + Only the installer service writes `/apps` (owner ruling, 2026-11-05). + Built: `/apps` is read-only in every declared row's view but the row + that declares `installs = true` (`toyos_manifest::Program::installs`), + which in the image is `pkg`'s. `pkg` is that service and not a client of + one: a launch already gives a row its own view, and who may launch it is + the `starts` that list it, so the authority is `images/system.toml`'s + alone and no port, protocol or daemon was added. `launch pkg install + ` installs; a `pkg` a shell spawns as a helper holds the shell's + view and refuses by name. Judged on the host, red with the shell's row + granted `installs`: `toyos_manifest`'s `only_the_installer_writes_apps` + and the build's `only_the_installer_s_view_writes_apps`, over every + committed config. **Its exit**: a shell's write under `/apps` is refused by the file server, and an install through the installer service still - commits; granting the shell's row `/apps` read-write reds the first. + commits. Owed on a machine: the first is the metal `app_view` row's + shell arm; the second is `pkg_install_gbae`'s + (`issues/the-guest-suite-runs-only-what-no-cheaper-tier-reaches.md`, + stage D), whose client launches `pkg`. `/dev/null` is a name only libc's `open` knows, answered with a kernel null handle (`SYS_NULL`): no view holds it, so `stat` of it and a program that does not open through libc find nothing. Whether views name it is diff --git a/issues/the-guest-suite-runs-only-what-no-cheaper-tier-reaches.md b/issues/the-guest-suite-runs-only-what-no-cheaper-tier-reaches.md index a0e36c6be16..91e730f895c 100644 --- a/issues/the-guest-suite-runs-only-what-no-cheaper-tier-reaches.md +++ b/issues/the-guest-suite-runs-only-what-no-cheaper-tier-reaches.md @@ -120,7 +120,7 @@ and NVMe. Exit: as stage A. `Gone` and reconnect, and the supervisor's restart, its bound and its refusal by name of a restart whose claim is held, as module tests. - metal `layout_fresh_boot`: `/home`'s layout on the disk. -- metal `pkg_install_gbae`: `pkg install` lands a package that runs. +- metal `pkg_install_gbae`: a launched `pkg install` lands a package that runs. - metal `kernel_log_file`, `log_partition_layout`, `log_partition_identity`: `/log` on the stick and its layout. - metal `file_mtime_survives_a_reboot`: a file's mtime survives a reboot. diff --git a/lib/manifest/src/lib.rs b/lib/manifest/src/lib.rs index 8ea5ba6787f..6f561db1b52 100644 --- a/lib/manifest/src/lib.rs +++ b/lib/manifest/src/lib.rs @@ -27,6 +27,7 @@ //! authorize a disk authorization the supervisor mints at its start ([`authorize`]) //! service a system service: its `HOME` is `/state/`, not the session's //! state it keeps machine state of its own in `/state/` +//! installs the installer: `/apps` is read-write in its view //! role a file server for ``: one process of it per role //! restart the supervisor starts it again when it ends //! pager started as a pager: it may make the paged objects its files are read through @@ -365,6 +366,9 @@ pub struct Program { /// It keeps machine state of its own in [`STATE`]`/` beside the /// session's `HOME`: pkg's accepted repository metadata, say. pub state: bool, + /// The installer: [`package::DIR`] is read-write in its view and + /// read-only in every other row's ([`Self::view`]). + pub installs: bool, /// The file-server roles this row serves, one process each: the supervisor starts /// the binary once per role, with the role as its argument and the /// acceptor of the role's port ([`role_dirs`] are the grants on it). @@ -443,6 +447,8 @@ impl Program { /// **`/log` is read-only but to the row that keeps the log** /// ([`Self::keeps_the_log`]): what is there proves a boot to the next /// loader pass (`toyos_logstream::STOPPED`). + /// **`/apps` is read-only but to the installer** ([`Self::installs`]): a + /// shell and what it spawns cannot rewrite an installed package. pub fn view(&self) -> Vec { match self.package() { Some(name) => { @@ -456,9 +462,10 @@ impl Program { None => whole_tree() .into_iter() .filter(|view| view.dir != STATE) - .map(|view| match view.dir == LOG { - true => View { write: self.keeps_the_log(), ..view }, - false => view, + .map(|view| match view.dir.as_str() { + LOG => View { write: self.keeps_the_log(), ..view }, + package::DIR => View { write: self.installs, ..view }, + _ => view, }) .chain(self.state_dir().map(|dir| data_dir(&dir, true))) .collect(), @@ -475,8 +482,8 @@ pub struct Manifest { /// key, so these have no declaration to come from. pub supervisor_serves: Vec, /// The connectors every program launched from `/apps` is given beside its - /// view ([`Program::view`]), and nothing else. `/apps` is writable to - /// the installer, so this row is the image's rather than the package's — + /// view ([`Program::view`]), and nothing else. A package is what an + /// archive carried, so this row is the image's rather than the package's — /// which is why a device class and a `syscap` right have no spelling on /// the package side at all. pub apps: Vec, @@ -653,6 +660,9 @@ pub fn render(manifest: &Manifest) -> Result, RenderError> { if program.state { out.push_str("state\n"); } + if program.installs { + out.push_str("installs\n"); + } for role in &program.roles { if role_dirs(role).is_none() { return Err(RenderError::NoSuchRole { program: program.name.clone(), role: role.clone() }); @@ -836,6 +846,7 @@ pub fn parse(text: &str) -> Manifest { "authorize" if authorize::Authorization::parse(rest).is_some() => program.authorize.push(rest.to_string()), "service" => program.service = true, "state" if rest.is_empty() => program.state = true, + "installs" if rest.is_empty() => program.installs = true, "role" => program.roles.push(rest.to_string()), "restart" if rest.is_empty() => program.restart = true, "pager" if rest.is_empty() => program.pager = true, @@ -883,6 +894,7 @@ mod tests { slots: true, holds: vec![toyos_logstream::CONSOLE_INPUT.into()], state: true, + installs: true, authorize: vec!["tables".into(), "designate:data".into(), "format:data".into()], ..Program::default() }, @@ -1050,15 +1062,15 @@ mod tests { } } - /// **Every row the image declares sees the whole tree read-write but - /// `/system` and `/state`, and of `/state` only its own directory**: a - /// service's and a row's that declares state, none for any other. The - /// installer and the shell are alike: neither has authority over `/apps` - /// the other lacks, nobody writes the signed image, and nobody reads or - /// rewrites another program's machine state, the supervisor's included. + /// **Every row the image declares sees the whole tree but `/state`, and of + /// `/state` only its own directory**: a service's and a row's that + /// declares state, none for any other. `/system`, `/log` and `/apps` are + /// read-only and the rest read-write: nobody writes the signed image, and + /// nobody reads or rewrites another program's machine state, the + /// supervisor's included. #[test] fn a_declared_row_sees_the_whole_tree_but_state_and_of_state_its_own() { - let m = parse("program pkg /system/bin/pkg\nstate\nprogram shell /system/bin/shell\n"); + let m = parse("program files /system/bin/files\nstate\nprogram shell /system/bin/shell\n"); let whole_but_state = |own: Option<&str>| -> Vec<_> { std::iter::once(system()) .chain( @@ -1066,7 +1078,7 @@ mod tests { .iter() .zip(["apps", "config", "home", "", "", ""]) .zip(["data", "data", "data", "log", "boot", "memory"]) - .map(|((dir, root), role)| (role, dir.to_string(), root.to_string(), *dir != "/log")), + .map(|((dir, root), role)| (role, dir.to_string(), root.to_string(), !["/log", "/apps"].contains(dir))), ) .chain(own.map(|name| ("data", format!("/state/{name}"), format!("state/{name}"), true))) .collect() @@ -1074,13 +1086,13 @@ mod tests { let s = sample(); for (row, own) in [ (m.program("shell").unwrap(), None), - (m.program("pkg").unwrap(), Some("pkg")), + (m.program("files").unwrap(), Some("files")), (s.program("compositor").unwrap(), Some("compositor")), ] { assert_eq!(views(row), whole_but_state(own), "{}", row.name); } // A row that keeps state keeps its session `HOME`; a service's is its state. - assert_eq!(m.program("pkg").unwrap().home(), session_home()); + assert_eq!(m.program("files").unwrap().home(), session_home()); assert_eq!(s.program("compositor").unwrap().home(), "/state/compositor"); assert_eq!(m.program("shell").unwrap().state_dir(), None); } @@ -1106,6 +1118,31 @@ mod tests { assert_eq!(log(&named, "logkeeper"), Some(false)); } + /// **Only the installer writes `/apps`**: the row that declares it, and + /// neither the shell that starts it nor a row named like it. Every other + /// directory of its view is what an undeclared row's is. + #[test] + fn only_the_installer_writes_apps() { + let m = parse( + "program pkg /system/bin/pkg\ninstalls\nprogram shell /system/bin/shell\nstarts pkg\n\ + program compositor /system/bin/compositor\nservice\n", + ); + let apps = |m: &Manifest, row: &str| { + views(m.program(row).unwrap()).into_iter().find(|v| v.1 == package::DIR).map(|v| (v.2, v.3)) + }; + assert_eq!(apps(&m, "pkg"), Some(("apps".into(), true))); + assert_eq!(apps(&m, "shell"), Some(("apps".into(), false))); + assert_eq!(apps(&m, "compositor"), Some(("apps".into(), false))); + let but_apps = |row: &str| views(m.program(row).unwrap()).into_iter().filter(|v| v.1 != package::DIR).collect::>(); + assert_eq!(but_apps("pkg"), but_apps("shell")); + // Named like the installer and declaring nothing. + let named = parse("program pkg /system/bin/pkg\n"); + assert_eq!(apps(&named, "pkg"), Some(("apps".into(), false))); + // A package's own directory stays read-only whatever the image's rows say. + let package = m.app_row("gbae", "/apps/gbae/gbae").unwrap(); + assert!(views(&package).iter().all(|v| !v.1.starts_with(package::DIR) || !v.3)); + } + #[test] fn the_same_manifest_renders_to_the_same_bytes() { assert_eq!(render(&sample()), render(&sample())); diff --git a/lib/manifest/src/package.rs b/lib/manifest/src/package.rs index 278b6543b9c..403c247d1bb 100644 --- a/lib/manifest/src/package.rs +++ b/lib/manifest/src/package.rs @@ -4,8 +4,8 @@ //! to resolve a launch, so the format lives beside [`crate::Manifest`] for the //! same reason: one renderer, one parser, one round-trip test. //! -//! **Nothing here is a grant.** `/apps` is writable to every row the image -//! declares, so a manifest is a peer's claim about itself: it says which binary +//! **Nothing here is a grant.** A package is what an archive carried, so a +//! manifest is the package's claim about itself: it says which binary //! *of its own directory* a launch starts. A device, a right and another //! package's binary have no spelling in this file at all. //! diff --git a/system/pkg/src/main.rs b/system/pkg/src/main.rs index 126ce12a3c0..a1d2634d4ab 100644 --- a/system/pkg/src/main.rs +++ b/system/pkg/src/main.rs @@ -1,8 +1,9 @@ -//! `/system/bin/pkg` — the installer, and an ordinary program. +//! `/system/bin/pkg` — the installer. //! -//! **It holds no authority a shell does not.** It claims no device, receives no -//! service and is endowed nothing; it writes under `/apps` because `/apps` is -//! writable to it. What it does is verify an archive against the release's own +//! **Its one authority is `/apps` read-write**, which its row's view holds and +//! no other row's does (`toyos_manifest::Program::installs`): launched, it +//! installs and removes; spawned as a helper it holds its parent's view, and +//! lists. What it does is verify an archive against the release's own //! `SHA256SUMS`, ask, unpack, and write the `manifest.toml` that records which //! binary the directory launches. //! @@ -71,7 +72,7 @@ fn install(file: &Path, assume_yes: bool) -> Result<(), String> { .map_err(|e| format!("pkg: cannot read {}: {e}", beside.display()))?; let want = sums::digest_for(&sums_text, &name)?; - let mut apps = apps()?; + let mut apps = writable_apps()?; let room = apps.room().map_err(|e| format!("pkg: {} answers no room: {e:?}", package::DIR))?; let (planner, got) = survey(file, Planner::new(&name, room.free, room.unit))?; if got != want { @@ -101,11 +102,17 @@ fn install(file: &Path, assume_yes: bool) -> Result<(), String> { /// `/apps`'s own capability, for what std has no word for: the room on its /// volume, and a sync of the whole volume that answers for every file in it. -fn apps() -> Result { +/// Refused where it is read-only, which it is to every row but the +/// installer's. +fn writable_apps() -> Result { let names = toyos::endow::namespace() .ok_or_else(|| String::from("pkg: this process holds no directory capabilities"))?; let name = format!("{}{}", toyos::fs::CAPABILITY_PREFIX, package::DIR); - toyos::fs::Dir::connect(names, &name).map_err(|e| format!("pkg: cannot reach {}: {e:?}", package::DIR)) + let apps = toyos::fs::Dir::connect(names, &name).map_err(|e| format!("pkg: cannot reach {}: {e:?}", package::DIR))?; + match apps.writable() { + true => Ok(apps), + false => Err(format!("pkg: {} is read-only to this process; run it with `launch pkg`", package::DIR)), + } } /// The first read: every header through `planner`, and the whole file's @@ -259,6 +266,7 @@ fn remove(name: &str) -> Result<(), String> { if package::package_of(&format!("{}/x", Package::dir(name))) != Some(name) { return Err(format!("pkg: {name:?} is not a package name")); } + writable_apps()?; let dir = Package::dir(name); let manifest = Package::path(name); let installed = fs::read_to_string(&manifest).ok().and_then(|t| Package::parse(&t).ok()); diff --git a/tests/guest/rust-tests/src/bin/app_view.rs b/tests/guest/rust-tests/src/bin/app_view.rs index 222caed8c7c..d79fb8177c2 100644 --- a/tests/guest/rust-tests/src/bin/app_view.rs +++ b/tests/guest/rust-tests/src/bin/app_view.rs @@ -24,6 +24,11 @@ //! Every arm runs, so one run names each one that is red. The job then holds //! the package to what it installed. //! +//! The job writes `/apps` because test-runner's row is this image's installer +//! (`installs = true`). The shell's row is not: a shell launched in the login +//! session redirects the same line into `/tmp`, which writes, and into the +//! package, which the file server refuses. +//! //! Then it grants the package a folder of the home, `/home/toy/Games` holding //! a ROM, through `/system/bin/grants`: refused `Apps/appview` by name, from //! the login session test-runner, its login authority, opened for its jobs. Granted it there, the package run as `game` browses @@ -63,6 +68,10 @@ const TEMPORARY: &str = "/tmp/apps/appview"; const MACHINE_TMP_FILE: &str = "/tmp/app_view_machine"; const OTHER_TMP_FILE: &str = "/tmp/apps/other/kept"; const TEMPORARY_KEPT: &[u8] = b"what the app wrote in its own /tmp"; +/// What the shell's line copies, and where its redirects go. +const SHELL_SOURCE: &str = "/system/etc/system.manifest"; +const SHELL_TMP_FILE: &str = "/tmp/app_view_shell"; +const SHELL_PACKAGE_FILE: &str = "/apps/appview/planted"; const APP: &str = "app"; const GAME: &str = "game"; const GAMES: &str = "/home/toy/Games"; @@ -143,11 +152,14 @@ fn job() { Ok(bytes) if bytes == TEMPORARY_KEPT => println!(" the app's /tmp write is in {TEMPORARY}"), other => red.push(format!("what the app wrote in its /tmp is not in {TEMPORARY}/kept: {other:?}")), } + shell_writes(&mut red); granted(&mut red); for dir in [PACKAGE, ROW_PACKAGE, "/apps/other", "/home/toy/Apps/other", HOME, GAMES, TEMPORARY, "/tmp/apps/other"] { let _ = fs::remove_dir_all(dir); } - let _ = fs::remove_file(MACHINE_TMP_FILE); + for file in [MACHINE_TMP_FILE, SHELL_TMP_FILE] { + let _ = fs::remove_file(file); + } if !red.is_empty() { panic!("app_view: {red:#?}"); } @@ -281,6 +293,23 @@ fn in_login(line: &str) -> std::process::Output { Command::new("/system/bin/shell").independent().args(["-c", line]).current_dir("/").output().expect("launch a shell") } +/// A shell's redirect writes `/tmp` and is refused in a package. +fn shell_writes(red: &mut Vec) { + let _ = fs::remove_file(SHELL_TMP_FILE); + let wrote = in_login(&format!("/system/bin/cat {SHELL_SOURCE} > {SHELL_TMP_FILE}")); + match fs::metadata(SHELL_TMP_FILE) { + Ok(file) if file.len() > 0 && wrote.status.success() => println!(" a shell's redirect into /tmp: written"), + other => red.push(format!("a shell's redirect into /tmp wrote {other:?}: {wrote:?}")), + } + let refused = in_login(&format!("/system/bin/cat {SHELL_SOURCE} > {SHELL_PACKAGE_FILE}")); + match fs::symlink_metadata(SHELL_PACKAGE_FILE) { + Err(e) if e.kind() == ErrorKind::NotFound && !refused.status.success() => { + println!(" a shell's redirect into a package: refused ({})", String::from_utf8_lossy(&refused.stderr).trim()) + } + other => red.push(format!("a shell's redirect into a package left {other:?}: {refused:?}")), + } +} + /// What the package saw as `game`: its working directory, the ROMs gbae's /// menu lists there, and whether its save beside the first was written. fn played(red: &mut Vec, when: &str) -> Option { diff --git a/tests/guest/rust-tests/src/bin/hosted_clang_hello.rs b/tests/guest/rust-tests/src/bin/hosted_clang_hello.rs index cb79eb15d23..8d2d34b25d2 100644 --- a/tests/guest/rust-tests/src/bin/hosted_clang_hello.rs +++ b/tests/guest/rust-tests/src/bin/hosted_clang_hello.rs @@ -1,4 +1,4 @@ -//! clang built for ToyOS, installed by `pkg`, compiles a C program here, and +//! clang built for ToyOS, installed by a launched `pkg`, compiles a C program here, and //! its driver links one, starting `ld.lld` as a child; the program runs, and //! what each wrote is the host's clang's bytes. //! @@ -7,6 +7,7 @@ //! `src/hello.c`, and what the host's clang made of it at `host/hello.o` and //! `host/a.out`. +use std::os::toyos::process::CommandExt; use std::path::{Path, PathBuf}; use std::process::Command; @@ -21,8 +22,10 @@ fn main() { let mut args = std::env::args().skip(1); let staged = PathBuf::from(args.next().expect("the staged directory, as the first argument")); let package = staged.join(args.next().expect("the package's file name, as the second argument")); + // Launched, and no helper: `/apps` is read-write in the installer's own + // view and read-only in this job's. let mut install = Command::new("/system/bin/pkg"); - install.arg("install").arg(&package).arg("--yes"); + install.independent().arg("install").arg(&package).arg("--yes"); run(install, "pkg install"); let out = Path::new(OUT); diff --git a/tests/images/hostedclangcase.toml b/tests/images/hostedclangcase.toml index 3e2752141b0..f1661221650 100644 --- a/tests/images/hostedclangcase.toml +++ b/tests/images/hostedclangcase.toml @@ -16,10 +16,15 @@ holds = ["console-input"] receives = ["log-wire"] restart = true +# `starts` because the job launches the installer: `/apps` is read-write in +# that row's view alone. [programs.test-runner] +starts = ["pkg"] -# The installer the job runs, as `images/system.toml` declares it. +# The installer the job launches, as `images/system.toml` declares it. [programs.pkg] +state = true +installs = true # The block service, the NVMe driver for the disk DATA is on, and the file # servers. diff --git a/tests/images/proctreecase.toml b/tests/images/proctreecase.toml index e2d8937e7f9..271d3374f75 100644 --- a/tests/images/proctreecase.toml +++ b/tests/images/proctreecase.toml @@ -10,6 +10,8 @@ # And `app_view`: test-runner's row lists `/apps`, so a job launches the # package it installed under the image's `[apps]` row and the view an # installed package is minted, and is refused one named after the `shell` row. +# The job writes its packages under `/apps` itself and rewrites one, which no +# installer does, so test-runner's row is this image's installer. # It grants that package a folder through `grants`, which test-runner's row # and the shell's list, in the login session test-runner opens for its jobs: # test-runner is a login authority, so its jobs launch in that session and @@ -43,6 +45,7 @@ restart = true syscap = ["dup", "roster"] starts = ["toybox", "shell", "grants", "/apps"] login = true +installs = true # `roster`, which a child the job spawns itself never holds: a child holding # it ran under this row, and `launch_toctou` asks which bytes that child was. From 83f1abb1d70926c4333388fac4b204addf2479f8 Mon Sep 17 00:00:00 2001 From: japabu Date: Wed, 11 Nov 2026 01:53:18 +0200 Subject: [PATCH 2/4] manifest: say what the rest of the installer's view is Co-Authored-By: Claude Fable 5.2 --- lib/manifest/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/manifest/src/lib.rs b/lib/manifest/src/lib.rs index 6f561db1b52..fd811290daf 100644 --- a/lib/manifest/src/lib.rs +++ b/lib/manifest/src/lib.rs @@ -1119,8 +1119,8 @@ mod tests { } /// **Only the installer writes `/apps`**: the row that declares it, and - /// neither the shell that starts it nor a row named like it. Every other - /// directory of its view is what an undeclared row's is. + /// neither the shell that starts it nor a row named like it. The rest of + /// its view is the shell's. #[test] fn only_the_installer_writes_apps() { let m = parse( From e78085e475709fe55b9d6e99d1c26e93b657238f Mon Sep 17 00:00:00 2001 From: japabu Date: Wed, 11 Nov 2026 02:21:14 +0200 Subject: [PATCH 3/4] Review r1 of #1203: the shell arm asserts the reason, and the records say which control reds what app_view's positive arm redirects into /home, the same volume and server as /apps, and its refusal must carry the read-only reason. The record names which control reds which test and states the exit's check. The manual says the installer's view. Storage rows starting with the supervisor's namespace are recorded as their own defect. Co-Authored-By: Claude Fable 5.2 --- build/build.rs | 4 +-- docs/src/architecture/files.md | 4 +-- images/system.toml | 4 +-- ...der-apps-and-the-installer-is-a-program.md | 4 ++- ...rogram-sees-only-the-files-it-was-given.md | 31 ++++++++++------ ...tart-holding-the-supervisors-whole-tree.md | 35 +++++++++++++++++++ lib/manifest/src/lib.rs | 6 ++-- tests/guest/rust-tests/src/bin/app_view.rs | 28 ++++++++------- 8 files changed, 84 insertions(+), 32 deletions(-) create mode 100644 issues/storage-rows-start-holding-the-supervisors-whole-tree.md diff --git a/build/build.rs b/build/build.rs index cef9bbbab51..39f23f978fb 100644 --- a/build/build.rs +++ b/build/build.rs @@ -3345,8 +3345,8 @@ mod tests { } /// **Only the installer's view holds `/apps` read-write**: `pkg` in the - /// shipped image, and in no config a shell or a row a shell spawns. A - /// test image's writer is the row its job installs through. + /// shipped image, and in no config a shell. A test image's writer is the + /// row its job installs through. #[test] fn only_the_installer_s_view_writes_apps() { let root = Path::new(env!("CARGO_MANIFEST_DIR")); diff --git a/docs/src/architecture/files.md b/docs/src/architecture/files.md index 8700e7ebd7c..beae25f3c2c 100644 --- a/docs/src/architecture/files.md +++ b/docs/src/architecture/files.md @@ -22,8 +22,8 @@ prefix. An empty view names nothing. reaches it only through the file picker, which hands over that one file. - **No special cases.** The boot partition is in the updater's view and nobody else's; login data is in the login authority's view alone; `/apps` is - writable only in the installer service's view, and every other program sees - it read-only. + writable only in the installer's view, and every other program sees it + read-only. The working directory is the client's: a spawn states the child's starting directory, which the child resolves in its own view. diff --git a/images/system.toml b/images/system.toml index 84566fbe54e..b03619e1ca9 100644 --- a/images/system.toml +++ b/images/system.toml @@ -54,8 +54,8 @@ folder = "read-write" [programs] # The installer: `installs = true` makes `/apps` read-write in its view, and # it is read-only in every other row's, so `launch pkg install ` installs -# and a shell, or a `pkg` it spawns as a helper, changes no package. Who may -# install is the `starts` that list it. +# and a shell's own writes and its helpers' are refused, a `pkg` it spawns as +# one among them. Who may install is the `starts` that list it. # `/state/pkg` is where the machine's copy of the repository metadata it last # accepted belongs (`toyos_update::repo::Holder::Machine`). pkg = { state = true, installs = true } diff --git a/issues/a-package-is-a-directory-under-apps-and-the-installer-is-a-program.md b/issues/a-package-is-a-directory-under-apps-and-the-installer-is-a-program.md index 880181caec9..8ab290b28b8 100644 --- a/issues/a-package-is-a-directory-under-apps-and-the-installer-is-a-program.md +++ b/issues/a-package-is-a-directory-under-apps-and-the-installer-is-a-program.md @@ -41,7 +41,9 @@ the binary in a ToyOS guest is this track's harness's job, not gbae's. `/apps` read-write (owner ruling, 2026-11-05; stage 2 of `issues/every-program-sees-only-the-files-it-was-given.md`): it installs and removes launched, `launch pkg install `, and a `pkg` spawned as - a helper lists and refuses the rest by name. `pkg` + a helper lists and refuses the rest by name. A caller that can launch + `pkg` answers its question itself, by `--yes` or the stdin it supplies, so + who decides an install is the `starts` that list `pkg`. `pkg` fetches, verifies, unpacks and commits, and it asks the user before it installs — at install, the moment the user typed the command, never at first run, so a refusal leaves nothing on disk and no answer has diff --git a/issues/every-program-sees-only-the-files-it-was-given.md b/issues/every-program-sees-only-the-files-it-was-given.md index 66d668d0c89..257d598a7a4 100644 --- a/issues/every-program-sees-only-the-files-it-was-given.md +++ b/issues/every-program-sees-only-the-files-it-was-given.md @@ -63,9 +63,13 @@ other, with the same per-session isolation (owner, 2026-11-05). `/system` read-only, its own `/tmp` (`toyos_manifest::app_temporary`, a directory of the machine's), and nothing else a file server serves (`toyos_manifest::Program::view`). Every row the image declares still sees - the whole tree, `/system` read-only and the rest read-write but `/state`, - of which each row holds only its own directory where it keeps state - (`service = true` or `state = true`: the daemons' own state is built). + the whole tree but `/state`, of which each row holds only its own + directory where it keeps state (`service = true` or `state = true`: the + daemons' own state is built); `/system` is read-only, `/log` and `/apps` + are read-only to all but one row each, and the rest is read-write. The + storage rows are started outside that + (`issues/storage-rows-start-holding-the-supervisors-whole-tree.md`), + which this stage's exit closes. Only the installer service writes `/apps` (owner ruling, 2026-11-05). Built: `/apps` is read-only in every declared row's view but the row that declares `installs = true` (`toyos_manifest::Program::installs`), @@ -74,13 +78,20 @@ other, with the same per-session isolation (owner, 2026-11-05). the `starts` that list it, so the authority is `images/system.toml`'s alone and no port, protocol or daemon was added. `launch pkg install ` installs; a `pkg` a shell spawns as a helper holds the shell's - view and refuses by name. Judged on the host, red with the shell's row - granted `installs`: `toyos_manifest`'s `only_the_installer_writes_apps` - and the build's `only_the_installer_s_view_writes_apps`, over every - committed config. **Its exit**: a shell's write under `/apps` is refused - by the file server, and an install through the installer service still - commits. Owed on a machine: the first is the metal `app_view` row's - shell arm; the second is `pkg_install_gbae`'s + view and refuses by name. Judged on the host: + `toyos_manifest`'s `only_the_installer_writes_apps`, red with the view + ignoring `installs`, and the build's + `only_the_installer_s_view_writes_apps` over every committed config, red + with that and with the shell's row granted `installs`. **Its exit**: a + shell's write under `/apps` is refused by the file server, and an install + through the installer service still commits. The first's check is the + metal `app_view` row's shell arm, in place of a boot with the shell's row + granted `/apps` read-write (orchestrator, 2026-11-11): the shell's + redirect into `/apps` is refused with the file server's read-only reason + while the same redirect into `/home` writes, and the two are one volume + and one server differing only in the grant, so the grant is what + refused. Owed on a machine: that row, and the second, which is + `pkg_install_gbae`'s (`issues/the-guest-suite-runs-only-what-no-cheaper-tier-reaches.md`, stage D), whose client launches `pkg`. `/dev/null` is a name only libc's `open` knows, answered with a kernel diff --git a/issues/storage-rows-start-holding-the-supervisors-whole-tree.md b/issues/storage-rows-start-holding-the-supervisors-whole-tree.md new file mode 100644 index 00000000000..8c21e38fa72 --- /dev/null +++ b/issues/storage-rows-start-holding-the-supervisors-whole-tree.md @@ -0,0 +1,35 @@ +--- +status: open +kind: defect +opened: 2026-11-11 +--- + +# Storage rows start holding the supervisor's whole-tree namespace + +By inspection, and unverified on a machine: `diskserver` and the file servers +for the `memory` and `system` roles are started holding a duplicate of the +supervisor's own namespace, every directory of the tree read-write but +`/system`, `/apps` and `/log` among them. + +The supervisor gives a storage row no view (`Grants::view` in +`system/supervisor/src/main.rs`), since a file server resolving a path +through itself waits for ever. Where such a row has no other name either, +`build_namespace` answers no namespace at all, and a spawn that names none +endows a duplicate of the spawner's own (`Helper::spawn`, +`sdk/toyos/src/spawn.rs`). The supervisor's own is the whole tree +(`toyos_manifest::whole_tree`). + +All three are the signed image's storage stack and open no path, so no +boundary between a session's programs and `/apps` or `/log` depends on it. +But "a storage row sees none" is not what happens, and no other row is +started this way. + +Evidence owed: `names.open("fs:/apps")` from one of those processes, which +answers a connection if this is right and `NotFound` if not. + +Exit: a storage row is started with an empty namespace where its row names +nothing, the check above refused on a machine, as part of stage 2 of +`issues/every-program-sees-only-the-files-it-was-given.md`, whose exit is +that nothing still sees the global tree. + +Owner: the file-isolation track. diff --git a/lib/manifest/src/lib.rs b/lib/manifest/src/lib.rs index fd811290daf..3f6ee17c254 100644 --- a/lib/manifest/src/lib.rs +++ b/lib/manifest/src/lib.rs @@ -448,7 +448,7 @@ impl Program { /// ([`Self::keeps_the_log`]): what is there proves a boot to the next /// loader pass (`toyos_logstream::STOPPED`). /// **`/apps` is read-only but to the installer** ([`Self::installs`]): a - /// shell and what it spawns cannot rewrite an installed package. + /// shell's own writes and its helpers' are refused. pub fn view(&self) -> Vec { match self.package() { Some(name) => { @@ -1138,8 +1138,8 @@ mod tests { // Named like the installer and declaring nothing. let named = parse("program pkg /system/bin/pkg\n"); assert_eq!(apps(&named, "pkg"), Some(("apps".into(), false))); - // A package's own directory stays read-only whatever the image's rows say. - let package = m.app_row("gbae", "/apps/gbae/gbae").unwrap(); + // A package's row has no word for it: its own directory stays read-only. + let package = Program { installs: true, ..m.app_row("gbae", "/apps/gbae/gbae").unwrap() }; assert!(views(&package).iter().all(|v| !v.1.starts_with(package::DIR) || !v.3)); } diff --git a/tests/guest/rust-tests/src/bin/app_view.rs b/tests/guest/rust-tests/src/bin/app_view.rs index d79fb8177c2..a99e4b934e6 100644 --- a/tests/guest/rust-tests/src/bin/app_view.rs +++ b/tests/guest/rust-tests/src/bin/app_view.rs @@ -26,8 +26,9 @@ //! //! The job writes `/apps` because test-runner's row is this image's installer //! (`installs = true`). The shell's row is not: a shell launched in the login -//! session redirects the same line into `/tmp`, which writes, and into the -//! package, which the file server refuses. +//! session redirects the same line into `/home`, which writes, and into the +//! package, which the file server refuses as read-only. Both are DATA's, one +//! volume and one server, and differ only in the grant. //! //! Then it grants the package a folder of the home, `/home/toy/Games` holding //! a ROM, through `/system/bin/grants`: refused `Apps/appview` by name, from @@ -70,8 +71,10 @@ const OTHER_TMP_FILE: &str = "/tmp/apps/other/kept"; const TEMPORARY_KEPT: &[u8] = b"what the app wrote in its own /tmp"; /// What the shell's line copies, and where its redirects go. const SHELL_SOURCE: &str = "/system/etc/system.manifest"; -const SHELL_TMP_FILE: &str = "/tmp/app_view_shell"; +const SHELL_HOME_FILE: &str = "/home/toy/app_view_shell"; const SHELL_PACKAGE_FILE: &str = "/apps/appview/planted"; +/// What std says of a file server's `ReadOnly`, which the shell prints. +const READ_ONLY: &str = "the directory is read-only to this process"; const APP: &str = "app"; const GAME: &str = "game"; const GAMES: &str = "/home/toy/Games"; @@ -157,7 +160,7 @@ fn job() { for dir in [PACKAGE, ROW_PACKAGE, "/apps/other", "/home/toy/Apps/other", HOME, GAMES, TEMPORARY, "/tmp/apps/other"] { let _ = fs::remove_dir_all(dir); } - for file in [MACHINE_TMP_FILE, SHELL_TMP_FILE] { + for file in [MACHINE_TMP_FILE, SHELL_HOME_FILE] { let _ = fs::remove_file(file); } if !red.is_empty() { @@ -293,18 +296,19 @@ fn in_login(line: &str) -> std::process::Output { Command::new("/system/bin/shell").independent().args(["-c", line]).current_dir("/").output().expect("launch a shell") } -/// A shell's redirect writes `/tmp` and is refused in a package. +/// A shell's redirect writes `/home` and is refused as read-only in a package. fn shell_writes(red: &mut Vec) { - let _ = fs::remove_file(SHELL_TMP_FILE); - let wrote = in_login(&format!("/system/bin/cat {SHELL_SOURCE} > {SHELL_TMP_FILE}")); - match fs::metadata(SHELL_TMP_FILE) { - Ok(file) if file.len() > 0 && wrote.status.success() => println!(" a shell's redirect into /tmp: written"), - other => red.push(format!("a shell's redirect into /tmp wrote {other:?}: {wrote:?}")), + let _ = fs::remove_file(SHELL_HOME_FILE); + let wrote = in_login(&format!("/system/bin/cat {SHELL_SOURCE} > {SHELL_HOME_FILE}")); + match fs::metadata(SHELL_HOME_FILE) { + Ok(file) if file.len() > 0 && wrote.status.success() => println!(" a shell's redirect into /home: written"), + other => red.push(format!("a shell's redirect into /home wrote {other:?}: {wrote:?}")), } let refused = in_login(&format!("/system/bin/cat {SHELL_SOURCE} > {SHELL_PACKAGE_FILE}")); + let said = String::from_utf8_lossy(&refused.stderr).into_owned(); match fs::symlink_metadata(SHELL_PACKAGE_FILE) { - Err(e) if e.kind() == ErrorKind::NotFound && !refused.status.success() => { - println!(" a shell's redirect into a package: refused ({})", String::from_utf8_lossy(&refused.stderr).trim()) + Err(e) if e.kind() == ErrorKind::NotFound && !refused.status.success() && said.contains(READ_ONLY) => { + println!(" a shell's redirect into a package: refused ({})", said.trim()) } other => red.push(format!("a shell's redirect into a package left {other:?}: {refused:?}")), } From 3298f192d7e851c0f1cc695ef02c27ebf05b3b2f Mon Sep 17 00:00:00 2001 From: japabu Date: Wed, 11 Nov 2026 03:58:12 +0200 Subject: [PATCH 4/4] Review r2 of #1203: the T14 row is recorded green, and process_tree's stale judge is recorded app_view's shell arm ran on the T14 at e78085e47, so the isolation record no longer owes it. The same boot's process_tree job passed and its judge did not: it counts a kernel line no spawn prints since the spawner lays programs out itself, which is main's and gets its own record. Two wording suggestions taken. Co-Authored-By: Claude Fable 5.2 --- ...rogram-sees-only-the-files-it-was-given.md | 4 +-- ...waits-for-a-kernel-line-no-spawn-prints.md | 33 +++++++++++++++++++ ...tart-holding-the-supervisors-whole-tree.md | 5 +-- lib/manifest/src/lib.rs | 2 +- 4 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 issues/process-trees-metal-judge-waits-for-a-kernel-line-no-spawn-prints.md diff --git a/issues/every-program-sees-only-the-files-it-was-given.md b/issues/every-program-sees-only-the-files-it-was-given.md index 257d598a7a4..ab53cffe92b 100644 --- a/issues/every-program-sees-only-the-files-it-was-given.md +++ b/issues/every-program-sees-only-the-files-it-was-given.md @@ -90,8 +90,8 @@ other, with the same per-session isolation (owner, 2026-11-05). redirect into `/apps` is refused with the file server's read-only reason while the same redirect into `/home` writes, and the two are one volume and one server differing only in the grant, so the grant is what - refused. Owed on a machine: that row, and the second, which is - `pkg_install_gbae`'s + refused. That row is green on the T14, both lines in its log (#1203). + Owed on a machine: the second, which is `pkg_install_gbae`'s (`issues/the-guest-suite-runs-only-what-no-cheaper-tier-reaches.md`, stage D), whose client launches `pkg`. `/dev/null` is a name only libc's `open` knows, answered with a kernel diff --git a/issues/process-trees-metal-judge-waits-for-a-kernel-line-no-spawn-prints.md b/issues/process-trees-metal-judge-waits-for-a-kernel-line-no-spawn-prints.md new file mode 100644 index 00000000000..7b65fbfe35e --- /dev/null +++ b/issues/process-trees-metal-judge-waits-for-a-kernel-line-no-spawn-prints.md @@ -0,0 +1,33 @@ +--- +status: open +kind: tooling +opened: 2026-11-11 +--- + +# process_tree's metal judge waits for a kernel line no spawn prints + +The metal `process_tree` row's judge (`process_tree` in `tests/toyos.rs`) +requires the kernel's log to say `spawn: /tmp/process_tree_invalid_elf: ` +twice, once per B: the kernel loader refusing the 64 zero bytes the job +writes there. Since the spawner lays a program out itself +(`toyos::elf::program::lay_out` in `Helper::spawn`, `sdk/toyos/src/spawn.rs`), +an image that is no ELF is refused in the caller before any syscall, so the +kernel never sees it and never prints the line. The job still passes: B +asserts only that the spawn failed. + +Evidence: the T14's `proctreecase` boot of #1203 at e78085e47. The job ended +`===TEST_END test_rs_process_tree exit=0===`, the kernel's log holds no line +naming `/tmp/process_tree_invalid_elf`, and the judge answered `the loader +refused the invalid executable 0 times, not once per B`; the row's other +three tests passed. #1203 changes no kernel, spawn or `process_tree` code. +https://github.com/ToyOSOrg/evidence/tree/eff6d9e767dc90c4472908660613872f68f76dbb/r3. + +So the row is red on every bench, and what it meant to hold, a spawn refused +after admission under B releasing what admission took, is no longer reached +by this job. + +Exit: the job reaches a kernel refusal after admission again, with an image +that lays out and the kernel refuses, and the judge counts that line; or the +arm and the judge's count go, if a cheaper test holds that release. + +Owner: the guest-suite track. diff --git a/issues/storage-rows-start-holding-the-supervisors-whole-tree.md b/issues/storage-rows-start-holding-the-supervisors-whole-tree.md index 8c21e38fa72..f70b24beb81 100644 --- a/issues/storage-rows-start-holding-the-supervisors-whole-tree.md +++ b/issues/storage-rows-start-holding-the-supervisors-whole-tree.md @@ -9,7 +9,7 @@ opened: 2026-11-11 By inspection, and unverified on a machine: `diskserver` and the file servers for the `memory` and `system` roles are started holding a duplicate of the supervisor's own namespace, every directory of the tree read-write but -`/system`, `/apps` and `/log` among them. +`/system`; `/apps` and `/log` are among them. The supervisor gives a storage row no view (`Grants::view` in `system/supervisor/src/main.rs`), since a file server resolving a path @@ -25,7 +25,8 @@ But "a storage row sees none" is not what happens, and no other row is started this way. Evidence owed: `names.open("fs:/apps")` from one of those processes, which -answers a connection if this is right and `NotFound` if not. +answers a connection if this is right; if not, the process holds no +namespace, or one without `fs:/apps`. Exit: a storage row is started with an empty namespace where its row names nothing, the check above refused on a machine, as part of stage 2 of diff --git a/lib/manifest/src/lib.rs b/lib/manifest/src/lib.rs index 3f6ee17c254..a9b29397af3 100644 --- a/lib/manifest/src/lib.rs +++ b/lib/manifest/src/lib.rs @@ -1138,7 +1138,7 @@ mod tests { // Named like the installer and declaring nothing. let named = parse("program pkg /system/bin/pkg\n"); assert_eq!(apps(&named, "pkg"), Some(("apps".into(), false))); - // A package's row has no word for it: its own directory stays read-only. + // Even declaring it, a package's own directory stays read-only. let package = Program { installs: true, ..m.app_row("gbae", "/apps/gbae/gbae").unwrap() }; assert!(views(&package).iter().all(|v| !v.1.starts_with(package::DIR) || !v.3)); }