Skip to content

The installers don't refuse an archive they can't verify: install.ps1 warns and installs, and install.sh claims a check it skipped or stops without saying why #1002

Closed

Description

@David-Noble-at-work

The installers don't refuse an archive they can't verify, and install.sh stops without saying why when a release lacks a piece. At 01634491:

install.ps1 warns and installs in two cases:

  • No checksums file in the release (install.ps1:372): it warns "Checksums file not found, skipping verification" (:398-399), then extracts and installs.
  • No line for the archive in it (:390): it warns "Checksum not found for , skipping verification" (:395-396), then goes on.

install.ps1 hashes with Get-FileHash (:302), which both PowerShell editions have, so it has no missing-tool case.

install.sh claims a check it didn't make when it has no SHA-256 tool. verify_checksum warns "No sha256sum or shasum found, skipping checksum verification" and returns 0 (install.sh:216-218); its caller then prints "Checksum verified" (:305) and the run installs.

install.sh stops with status 1 and no message when a piece is missing. It runs under set -o errexit -o nounset -o pipefail (:9), so when a lookup's grep matches nothing, the assignment fails and the run ends before the branch that would say why:

  • No checksums file in the release: the run ends at :287; its warning (:309-310) never runs.
  • No line for the archive: the run ends at :302; its warning (:306-307) never runs. A checksums download GitHub refuses ends here too: download_asset calls curl without --fail (:191, :193), so GitHub's error body is saved as the checksums file.
  • No archive for this platform: the run ends at :281; the error naming the missing asset (:282-284) never prints.

Both installers find the line by pattern, not by exact name: grep "${archive_name}" (install.sh:302) and -match $archiveName (install.ps1:390). Each . matches any character, the match isn't anchored, and -match ignores case.

Since #1001 (#947), self upgrade refuses a release that lacks the archive or the checksums file (cmd/internal/cli/selfupgrade_release.go:370-373) and a checksums file with no line for the archive (cmd/internal/cli/selfupgrade_archive.go:432-436), finding the line by exact name (listedChecksum, selfupgrade_archive.go:500-514). It hashes the archive as it downloads it, so it needs no tool. The installers are the weaker path to the same archive. No installer test covers any of these cases.

Found 2026-09-30 during #947's research; reproduced 2026-10-01 at 01634491 by running the installers' own lines against local copies of the release metadata and checksums file, and for the no-tool case with sha256sum and shasum off PATH.

Corrected 2026-10-01. This first said both installers warn and carry on when the checksums file, the line or a SHA-256 tool is missing. That holds for install.ps1's file and line, not for install.sh: there a missing file or line ends the run silently, and only the missing tool carries on, while reporting "Checksum verified". install.ps1 has no missing-tool case. Added: the missing archive and the refused checksums download end install.sh the same way, and -match ignores case. The title changed to match, and the resolution widened, by ruling (below).

Resolution

Ruled 2026-10-01, agreeing to correct this issue and widen it to install.sh's silent stops:

  • Before extracting anything, each installer refuses an archive it can't verify, with an error naming what is missing: the checksums file, the archive's line in it, or, for install.sh, both sha256sum and shasum.
  • install.sh never stops without saying why: a missing archive, checksums file or line, and a refused download, are each reported.
  • install.sh never reports a check it didn't make.
  • Each installer finds the archive's line by exact name, <hex> <name> or <hex> *<name>, as listedChecksum does.

Plan and design documents

Kind Document
Plan docs/plans/fix/1002-installers-install-an-archive.md

Activity

  1. changed the title [-]The installers install an archive they could not verify: a missing checksums file, line or SHA-256 tool is only a warning[/-] [+]The installers don't refuse an archive they can't verify: install.ps1 warns and installs, and install.sh claims a check it skipped or stops without saying why[/+] on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions