Skip to content

Commit

Permalink
Don't allow installing packages without ARCH or OS
Browse files Browse the repository at this point in the history
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: rpm-software-management#3344
  • Loading branch information
ffesti committed Nov 29, 2024
1 parent 71e88ec commit b57d31a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/rpmte.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b57d31a

Please sign in to comment.