Documentation
¶
Overview ¶
Package pathguard is the refusal every recursive delete of a derived directory passes, and the containment check every write at a manifest-named path passes. The install clears a directory named by a registry's resolve response and writes a file the same response names; neither string is covered by the archive digest or the attestation, so each is judged here before the filesystem sees it. Exported so the desktop client, which has the same two seams, can share it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirectlyUnder ¶
DirectlyUnder reports whether dir is exactly one path segment below root (both cleaned): the one shape a managed install directory may have, so a destination a bad name resolved to is never cleared whatever it is.
func RefuseDangerousDir ¶
RefuseDangerousDir refuses a directory this code must never delete recursively: one that is not absolute, a filesystem root, the home directory itself, or an ancestor of it. Anywhere else is the person's to lose — the managed roots are theirs to relocate.
Types ¶
This section is empty.