From 13941ce6cce852c3f311d491ca1514e4ad813fbb Mon Sep 17 00:00:00 2001 From: diviocity Date: Mon, 30 Nov 2026 03:18:07 +0100 Subject: [PATCH] Initialize public feed verification under long image staging paths --- tests/FEED.md | 2 ++ tests/feed.v | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/FEED.md b/tests/FEED.md index 632bf9a..379ca01 100644 --- a/tests/FEED.md +++ b/tests/FEED.md @@ -139,6 +139,8 @@ The worker used a disposable test signer in `foundation/keyring-04`. It rejected ### Assemble an image with an offline repository +A public-only consumer can live below a long staging path. `feed trust` checks the fingerprint in a short private GnuPG directory and copies the public keybox and trust database to the consumer. Fresh clients for both architectures installed four packages from the signed layout feed. A wrong fingerprint and a by-name attempt to install the absent `vinix-release-desktop` both failed. The worker keeps the successful install receipts in `foundation/public-trust-install-03/consumer-with-a-deep-image-generation-directory`, manifest SHA-256 `28b5580486b8c36bd67df12b3e51924f96685aae447326aaacca88e6a32fede5`, and the partial-feed rejection in `foundation/partial-desktop-reject-03`, manifest SHA-256 `ad53b5e5fdcd0461ee72b5a9b9c0fb3c4a8b7e878c100f722c3e3c54ddf7dbc8`. + Start with a fresh `feed install` client that includes `vinix-keyring`. Run this on the build worker with GNU cp, GnuPG and the installed-root auditor. The resulting `$output/root` is the input to the architecture's image builder. ```sh diff --git a/tests/feed.v b/tests/feed.v index 33dc4fb..e32d6dc 100644 --- a/tests/feed.v +++ b/tests/feed.v @@ -23,8 +23,12 @@ fn gpg(keyring string, args []string) !string { fn trust_key(state string, key string, fingerprint string) ! { trust := os.join_path(state, 'verify') os.mkdir(trust, mode: 0o700)! - gpg(trust, ['--import', key])! - records := gpg(trust, ['--with-colons', '--fingerprint', '--list-keys'])!.split_into_lines() + // GnuPG uses Unix sockets even for public imports. Deep SDK paths can + // exceed the socket name limit. Transfer only its public databases. + home := output(['mktemp', '-d', '/tmp/vinix-feed.XXXXXXXX'])!.trim_space() + defer { os.rmdir_all(home) or {} } + gpg(home, ['--no-autostart', '--import', key])! + records := gpg(home, ['--no-autostart', '--with-colons', '--fingerprint', '--list-keys'])!.split_into_lines() fingerprints := records.filter(it.starts_with('fpr:')) if records.filter(it.starts_with('pub:')).len != 1 || fingerprints.len == 0 || fingerprints[0].split(':')[9] != fingerprint { @@ -32,7 +36,12 @@ fn trust_key(state string, key string, fingerprint string) ! { } ownertrust := os.join_path(trust, 'fixture-ownertrust') os.write_file(ownertrust, fingerprint + ':6:\n')! - gpg(trust, ['--import-ownertrust', ownertrust])! + gpg(home, ['--no-autostart', '--import-ownertrust', ownertrust])! + gpg(home, ['--no-autostart', '--check-trustdb'])! + keybox := if os.is_file(os.join_path(home, 'pubring.kbx')) { 'pubring.kbx' } else { 'pubring.gpg' } + for filename in [keybox, 'trustdb.gpg'] { + os.cp(os.join_path(home, filename), os.join_path(trust, filename))! + } } // Keep private signing material out of every repository and consumer root. -- 2.56.1