FR-001checkpassingThe bytes of an artifact MUST be checked against the SHA-256 of its pin before anything is unpacked, and a download whose SHA-256 differs MUST be refused with both hashes named and no file returned.
0002-native-pinned-install · owner if · domain commons
FR-001checkpassingThe bytes of an artifact MUST be checked against the SHA-256 of its pin before anything is unpacked, and a download whose SHA-256 differs MUST be refused with both hashes named and no file returned.
FR-002checkpassingAn artifact MUST be unpacked in memory by its format: zip, tar (plain, or compressed with gzip or xz, found by its first bytes) or file (the bytes are the program, named by the program's name, with .exe added for Windows); every path in it MUST be a path inside the folder (never absolute, never with ..), and an archive with a path that is not MUST be refused whole.
FR-003checkpassingThe program MUST be in the unpacked files, at the folder of the pin (binPath) with the program's name (and .exe on Windows), and an artifact that does not hold it MUST be refused naming the path.
FR-004checkpassingThe install record MUST name the tool, the version, the platform, the address, the SHA-256 of the artifact, the path of the program, the SHA-256 of each file by its path and the target of each symbolic link by its path, MUST be written as JSON with its keys in order, two spaces, and a final line break, and MUST be read back, a text that is not a record being refused with the reason.
FR-005checkpassinginstallDrift MUST find, by comparing the files found in a tool's folder with its record, every file or symbolic link changed, missing or extra, in the order of the paths, and MUST say where the record's artifact is not the one the pin now names.
FR-006checkpassingA shim MUST be a POSIX sh script that runs the installed program with its arguments, or on Windows a .cmd file; a command name that is not letters, digits, dots, underscores and hyphens, a path with a line break, and on Windows a path with ", %, ^, &, |, < or > MUST be refused.
FR-007checkpassingA symbolic link in an archive MUST be kept only where its target is a relative path that stays inside the folder the archive is unpacked into (never absolute, never with a backslash or a drive letter, never above the root of the folder), is a file or a folder the archive holds, or another link whose own target is such (a chain of any depth that does not come back to a link it has passed), is not the folder the link is in or one above it, and passes through no link on the way (no folder of the target's path is a link); no file, folder or link MUST be written below a link, and a link MUST NOT have the path of a file, a folder or another link; an archive with a link that fails any of these MUST be refused whole, with the path of the link and one reason from a closed list, and nothing written.
Cited by: Archon dialect: native-pinned, links
FR-008checkpassingA hard link in an archive MUST be a copy of the file it names, which the archive holds before it; the unpacking MUST give the paths of the files the archive marks as executable (any execute bit of their mode), and where the system cannot make symbolic links (Windows) a link to a file MUST be a copy of the file and a link to a folder MUST be refused.
Cited by: Archon dialect: native-pinned, links
../evil, When it is unpacked, Then the whole archive is refused, per FR-002..tar.xz and a Temurin JRE as a .tar.gz, each with relative links inside its folder, When each is unpacked, Then the files and the links come back, and a link to an absolute path, above the folder, to nothing or through another link refuses the archive whole, per FR-007.bun and the path /home/a/b, When the shim is made for Linux and for Windows, Then each is the right text, per FR-006.SC-001success criterionNo byte of an artifact is unpacked before its hash is checked.
SC-002success criterionA change to an installed file is always found.
Archon dialect: native-pinned, links, Native-pinned store, Native-pinned pin tool