From b57d31afb7e0de1d1962b3f423ea9b1175b8fd18 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Fri, 29 Nov 2024 09:22:53 +0100 Subject: [PATCH] Don't allow installing packages without ARCH or OS We had an exception for public key packages in rpmte. With those now being handled in the keystore without going through the transaction machinery this is no longer needed. This also prevents people from just contrsucting their own pubkey packages and install them. Resolves: #3344 --- lib/rpmte.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/rpmte.cc b/lib/rpmte.cc index 6b98918752..cce595bb1e 100644 --- a/lib/rpmte.cc +++ b/lib/rpmte.cc @@ -159,8 +159,7 @@ static int addTE(rpmte p, Header h, fnpyKey key, rpmRelocation * relocs) p->arch = headerGetAsString(h, RPMTAG_ARCH); p->os = headerGetAsString(h, RPMTAG_OS); - /* gpg-pubkey's dont have os or arch (sigh), for others they are required */ - if (!rstreq(p->name, "gpg-pubkey") && (p->arch == NULL || p->os == NULL)) + if (p->arch == NULL || p->os == NULL) goto exit; p->isSource = headerIsSource(h);