From 19d4dc1a8fe19c9d9fd0cf95e3441c5bdbec8e5f Mon Sep 17 00:00:00 2001 From: ewt Date: Sat, 31 Aug 1996 18:34:51 +0000 Subject: [PATCH] supports broken md5sum's that used to be generated on SPARCs CVS patchset: 1004 CVS date: 1996/08/31 18:34:51 --- lib/verify.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/verify.c b/lib/verify.c index 05e29e0..8b4865e 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -14,12 +14,18 @@ int rpmVerifyFile(char * prefix, Header h, int filenum, int * result) { int_32 * sizeList, * mtimeList; unsigned short * modeList, * rdevList; char * filespec; - int type, count; + int type, count, rc; struct stat sb; unsigned char md5sum[40]; char linkto[1024]; int size; int_32 * uidList, * gidList; + int useBrokenMd5; + + if (getEntry(h, RPMTAG_RPMVERSION, NULL, NULL, NULL)) + useBrokenMd5 = 0; + else + useBrokenMd5 = 1; getEntry(h, RPMTAG_FILEMODES, &type, (void **) &modeList, &count); @@ -58,9 +64,13 @@ int rpmVerifyFile(char * prefix, Header h, int filenum, int * result) { if (flags & VERIFY_MD5) { getEntry(h, RPMTAG_FILEMD5S, &type, (void **) &md5List, &count); - if (mdfile(filespec, md5sum)) - *result |= VERIFY_MD5; - else if (strcmp(md5sum, md5List[filenum])) + if (useBrokenMd5) { + rc = mdfileBroken(filespec, md5sum); + } else { + rc = mdfile(filespec, md5sum); + } + + if (rc || strcmp(md5sum, md5List[filenum])) *result |= VERIFY_MD5; free(md5List); } -- 2.7.4