]> git.ipfire.org Git - thirdparty/systemd.git/commit
import: don't assert on missing signature file
authorFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 27 May 2026 13:03:26 +0000 (15:03 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 27 May 2026 16:24:54 +0000 (01:24 +0900)
commit223ca6d2d35ad3cac798a14958b07923154091fe
treec94d86874d87378314202dd0018e6527482dde45
parent63ff5dc1e5b588b39eb26dc143f7c94d97e02c8e
import: don't assert on missing signature file

Since ac9edf991142c1597c8d86431ee9bd50c21bce41 even the per-file
verification style uses detached signatures instead of inline ones.
That commit dropped the inline verification fallback, but it didn't
update the raw_pull_job_on_finished()/tar_pull_job_on_finished()
callbacks, which caused the per-file verification to silently fall
through the signature check and eventually hit the now unconditional
assert in pull_verify():

~# importctl pull-tar -mN https://distfiles.gentoo.org/releases/amd64/autobuilds/20260426T153103Z/stage3-amd64-systemd-20260426T153103Z.tar.xz
...
Acquired 1.2G for https://distfiles.gentoo.org/releases/amd64/autobuilds/20260426T153103Z/stage3-amd64-systemd-20260426T153103Z.tar.xz.
Download of https://distfiles.gentoo.org/releases/amd64/autobuilds/20260426T153103Z/stage3-amd64-systemd-20260426T153103Z.tar.xz complete.
SHA256 checksum of https://distfiles.gentoo.org/releases/amd64/autobuilds/20260426T153103Z/stage3-amd64-systemd-20260426T153103Z.tar.xz is valid.
Assertion 'signature_job->state == PULL_JOB_DONE' failed at src/import/pull-common.c:588, function pull_verify(). Aborting.

To fix this, let's drop the now outdated guards from the callbacks,
given that both per-file and per-directory verification uses detached
signatures. Also, drop some dead code along the way, given we no longer
need to even determine the verification style anymore.

With this, the reproducer above now shows a proper error:

...
Acquired 1.2G for https://distfiles.gentoo.org/releases/amd64/autobuilds/20260426T153103Z/stage3-amd64-systemd-20260426T153103Z.tar.xz.
Download of https://distfiles.gentoo.org/releases/amd64/autobuilds/20260426T153103Z/stage3-amd64-systemd-20260426T153103Z.tar.xz complete.
Failed to retrieve signature file, cannot verify. (Try --verify=no?)

Also, both --verify=checksum/--verify=no keep working as expected.

Follow-up for ac9edf991142c1597c8d86431ee9bd50c21bce41.
Resolves: #41895
src/import/pull-common.c
src/import/pull-raw.c
src/import/pull-tar.c