From the volume UUID commit's security review. A folder at its own
recorded path on a disk numbered anew (platform.SameFolder's renumbered
case) must now also be on the volume its state records, when both are
known (platform.KeepsVolume): the finder checks it (finder.sameFolder,
Env.keepsVolume, so a launch refuses with vm_other_folder) and so does
recordFolder under the state's lock, so a copy of the disk with a volume
ID of its own mounted at the folder's path is another folder. A volume
that can't be told leaves the device's rule, as for a state that
records none. mountedBy and mountsRepo keep the check without volumes
(madeFor), which errs towards warning.
hereOf reads the folder's identity, uniqueness, owner and volume from
one open folder (platform.StatFolder, now with Owner), so the folder
checked as the user's is the one matched and recorded. StatFolder is
one function for macOS and Linux (folderstat_unix.go) over each
system's openFolder, which SameFolder's renumbered case uses too, in
place of openFolderID and darwin's copy.
devvm ls and devvm space look volumes up through the run's Env
(Env.FolderOf, Inventory.List(ctx, e)), each mount once a run, in
place of diskutil for each VM; FolderOf, parentVolume and movedAway go.
FolderDevice is unexported (folderDevice), so only platform reads a
device; OnRecordedDisk takes a record without a device as on any disk.
The folder-ids rule tracks names assigned from such names, however
many steps on, and maps keyed by an identity, indexed or in a map's
literal, without counting a struct literal's field; its loop is
sitesWhereIn, shared with sitesWhere. The hdiutil e2e check makes sure
macOS gave the disk a new number, attaching up to three images first,
and is skipped when it never does. The design notes say who can forge
a volume ID and what it gets them.
Tests: TestKeepsVolume, OnRecordedDisk without a device,
TestRenumberedOnAnotherVolume (a launch and recordFolder),
TestListLooksUpVolumesOnce, StatFolder's Owner on both systems, the
folder-ids rule's new cases, and fixture_v010_renumbered.txtar (another
volume at its own path refused with nothing recorded; ls calls the
moved folder gone by its recorded volume, where it said not_connected).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The structure test's read-limits rule fails, outside tests, on an
io.ReadAll whose reader isn't an io.LimitReader made in the call, unless
unboundedReads lists its function with why; a listed function that has
none fails. Four are listed: the status line's tail of the run's own
log, which only that run writes, and the three test stubs' reads of the
standard input devvm under test writes and closes. readCases breaks it
on a renamed io import, a reader limited before the call and a read in
a function literal.
It shares dropped-errors' walk and table check (siteRule, sitesWhere).
Named as the guard in codebase-standards' Bound what you don't control
and rules.md, and in Contributing's structure test.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The structure test's dropped-errors rule fails, outside tests, on a
function that assigns a Wait's error, or a strconv parse's (Atoi, the
Parse functions, Unquote, UnquoteChar, QuotedPrefix), to _, unless
droppedErrors lists it with why; a listed function that drops none
fails. None is listed today. errorCases breaks it on each shape: an
assignment, both of a process's Wait results in a goroutine, a renamed
strconv import, a var and an if's init.
Named as the guard in codebase-standards' Never fail silently and
rules.md, and in Contributing's structure test.
Co-Authored-By: Claude Opus 5.5 <[email protected]>