Skip to content

Commit

Permalink
Remove lead checks other than the "magic number" check
Browse files Browse the repository at this point in the history
Remove checks on the lead's "signature type" and "rpm package format
version" fields. The lead is a long, long obsolete structure and the
less we look at it the better, these checks accomplish exactly nothing
at all.

Fixes: #2423
  • Loading branch information
dralley authored and pmatilai committed Oct 26, 2023
1 parent c97fd93 commit b3449a0
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lib/rpmlead.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,8 @@ rpmRC rpmLeadWrite(FD_t fd, Header h)
static rpmRC rpmLeadCheck(struct rpmlead_s *lead, char **msg)
{
if (memcmp(lead->magic, lead_magic, sizeof(lead_magic))) {
*msg = xstrdup(_("not an rpm package"));
return RPMRC_NOTFOUND;
}
if (lead->signature_type != RPMSIGTYPE_HEADERSIG) {
*msg = xstrdup(_("illegal signature type"));
return RPMRC_FAIL;
}
if (lead->major < 3 || lead->major > 4) {
*msg = xstrdup(_("unsupported RPM package version"));
return RPMRC_FAIL;
*msg = xstrdup(_("not an rpm package"));
return RPMRC_NOTFOUND;
}
return RPMRC_OK;
}
Expand Down

0 comments on commit b3449a0

Please sign in to comment.