diff options
author | ewt <devnull@localhost> | 1996-08-31 18:34:51 +0000 |
---|---|---|
committer | ewt <devnull@localhost> | 1996-08-31 18:34:51 +0000 |
commit | 19d4dc1a8fe19c9d9fd0cf95e3441c5bdbec8e5f (patch) | |
tree | 6abe265b03222b015387a8766c5b589c3614e31a /lib/verify.c | |
parent | f1457cd67d2d041cc47a83975b9b17e196d9a6c4 (diff) | |
download | librpm-tizen-19d4dc1a8fe19c9d9fd0cf95e3441c5bdbec8e5f.tar.gz librpm-tizen-19d4dc1a8fe19c9d9fd0cf95e3441c5bdbec8e5f.tar.bz2 librpm-tizen-19d4dc1a8fe19c9d9fd0cf95e3441c5bdbec8e5f.zip |
supports broken md5sum's that used to be generated on SPARCs
CVS patchset: 1004
CVS date: 1996/08/31 18:34:51
Diffstat (limited to 'lib/verify.c')
-rw-r--r-- | lib/verify.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/verify.c b/lib/verify.c index 05e29e057..8b4865e93 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); } |