[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: rpm-4.0.4: rpm -V md5sum failure, file corruption



An update on this problem...

I patched rpm-4.0.4 to print out the md5sums it's using in its
comparisons, the one from the rpm database and the one it calculates
from the file on disk.  In my "failure" case, where the md5sum fails
temporarily, the md5sum that's wrong is the one in the rpmdb, not the
one calculated from the file on disk.

Here's the patch I'm using:
diff -urbB rpm-4.0.4.orig/lib/verify.c rpm-4.0.4/lib/verify.c
--- rpm-4.0.4.orig/lib/verify.c Mon Jan 21 09:18:27 2002
+++ rpm-4.0.4/lib/verify.c      Wed Jan 22 10:28:28 2003
@@ -147,10 +147,15 @@
            *result |= RPMVERIFY_MD5;
        else {
            rc = domd5(filespec, md5sum, 1);
-           if (rc)
+            if (rc) {
                *result |= (RPMVERIFY_READFAIL|RPMVERIFY_MD5);
-           else if (strcmp(md5sum, md5List[filenum]))
+                fprintf(stderr, "md5sum read failure for %s: (%s)
headers vs. (%s) file - %m\n",
+                        filespec, md5sum, md5List[filenum]);
+            } else if (strcmp(md5sum, md5List[filenum])) {
                *result |= RPMVERIFY_MD5;
+                fprintf(stderr, "md5sum mismatch for %s: (%s) headers
vs. (%s) file\n",
+                        filespec, md5sum, md5List[filenum]);
+            }
        }
        md5List = hfd(md5List, mdt);
     }

Now, with rpm -Va a few thousand times, I get one failure:

md5sum mismatch for /usr/lib/libgmp.so.2.0.2:
(b009459132ff2ae89747ce284c36bbd7) headers vs.
(eea415cb7364b72eb7098b8bff4d7eff) file
..5.....   /usr/lib/libgmp.so.2.0.2

When the failure goes away, and I verify again using the md5sum program,
I see that

eea415cb7364b72eb7098b8bff4d7eff

is the correct checksum.  So, for a brief moment, rpm has the wrong
md5sum in its database.

Is this helpful at all?

I'm currently rerunning tests with rpm-4.1 to see if it was fixed along
the way.

Matt





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []