From 05b233ddbe3a64089001b3d912c9a9080806953e Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 18 Apr 2018 14:20:41 +0300 Subject: [PATCH] Plug the last data "leak" from rpmlead Up to commit 45c2f3ffa63188fbc1289b53ea7cd73551de0509 we were still using the lead to confirm source vs binary package, but now we dont need even that. Means the zombie data structure that's supposedly been dead for the last 20+ years is truly gone now. We still dutifully read/write and validate it, but no actual data from it is used. --- lib/rpmchecksig.c | 2 +- lib/rpmlead.c | 7 ++----- lib/rpmlead.h | 3 +-- sign/rpmgensig.c | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c index 20e9af6d21..6b07bcf6f9 100644 --- a/lib/rpmchecksig.c +++ b/lib/rpmchecksig.c @@ -168,7 +168,7 @@ rpmRC rpmpkgRead(struct rpmvs_s *sigset, FD_t fd, memset(&blob, 0, sizeof(blob)); memset(&sigblob, 0, sizeof(sigblob)); - if ((xx = rpmLeadRead(fd, NULL, &msg)) != RPMRC_OK) { + if ((xx = rpmLeadRead(fd, &msg)) != RPMRC_OK) { /* Avoid message spew on manifests */ if (xx == RPMRC_NOTFOUND) msg = _free(msg); diff --git a/lib/rpmlead.c b/lib/rpmlead.c index 981bc8f609..45b1c6f8ed 100644 --- a/lib/rpmlead.c +++ b/lib/rpmlead.c @@ -106,7 +106,7 @@ static rpmRC rpmLeadCheck(struct rpmlead_s *lead, char **msg) return RPMRC_OK; } -rpmRC rpmLeadRead(FD_t fd, int *type, char **emsg) +rpmRC rpmLeadRead(FD_t fd, char **emsg) { rpmRC rc = RPMRC_OK; struct rpmlead_s l; @@ -129,10 +129,7 @@ rpmRC rpmLeadRead(FD_t fd, int *type, char **emsg) rc = rpmLeadCheck(&l, &err); } - if (rc == RPMRC_OK) { - if (type != NULL) - *type = l.type; - } else { + if (rc != RPMRC_OK) { if (emsg != NULL) *emsg = err; else diff --git a/lib/rpmlead.h b/lib/rpmlead.h index 48d4df2871..b344ed4600 100644 --- a/lib/rpmlead.h +++ b/lib/rpmlead.h @@ -30,11 +30,10 @@ rpmRC rpmLeadWrite(FD_t fd, Header h); /** \ingroup lead * Read lead from file handle. * @param fd file handle - * @retval type RPMLEAD_BINARY or RPMLEAD_SOURCE on success * @retval emsg failure message on error (malloced) * @return RPMRC_OK on success, RPMRC_FAIL/RPMRC_NOTFOUND on error */ -rpmRC rpmLeadRead(FD_t fd, int *type, char **emsg); +rpmRC rpmLeadRead(FD_t fd, char **emsg); #ifdef __cplusplus } diff --git a/sign/rpmgensig.c b/sign/rpmgensig.c index 2f9e994c30..d46fb015e7 100644 --- a/sign/rpmgensig.c +++ b/sign/rpmgensig.c @@ -525,7 +525,7 @@ static int rpmSign(const char *rpm, int deleting, int signfiles) if (manageFile(&fd, rpm, O_RDWR)) goto exit; - if ((rc = rpmLeadRead(fd, NULL, &msg)) != RPMRC_OK) { + if ((rc = rpmLeadRead(fd, &msg)) != RPMRC_OK) { rpmlog(RPMLOG_ERR, "%s: %s\n", rpm, msg); goto exit; }