Skip to content

Commit

Permalink
Don't allow installing gpg-pubkey packages
Browse files Browse the repository at this point in the history
People could install gpg-pubkey if they had the ARCH and OS tag set. Do
not allow that.
  • Loading branch information
ffesti committed Nov 29, 2024
1 parent d0d2438 commit 5954bac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/rpmte.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ static int addTE(rpmte p, Header h, fnpyKey key, rpmRelocation * relocs)
}
}

if (p->type != TR_REMOVED && rstreq(p->name, "gpg-pubkey")) {
rpmlog(RPMLOG_ERR, "installing gpg-pubkey packages is not allowed. use rpmkeys instead\n");
goto exit;
}

p->isSource = headerIsSource(h);

p->NEVR = headerGetAsString(h, RPMTAG_NEVR);
Expand Down

0 comments on commit 5954bac

Please sign in to comment.