From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020513 Description of problem: There is a while loop in the rpm source file lib/misc.c domd5() function that is supposed to calculate the md5sum for a file. However, the while loop doesn't actually do anything; that is, it reads the file, but does not update the digest. This results in config files always appearing to be modified, which causes RPM to perform the wrong actions when determining the fate of a config file. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.Create a spec file that builds an RPM with one %config(noreplace) file. The file's contents should be the version and release of the RPM. 2.Build and install this RPM. 3.Change the release in the spec file, and then build and upgrade the resulting RPM. Actual Results: The new RPM ended up depositing its config file with the .rpmnew extension. Expected Results: Since the config file hadn't actually changed from the first installation, it should have been overwritten with the contents of the config file from the new release. Additional info: fdUpdateDigests() should probably be called in the code below. [admin@apphost-61 rpm-4.0.4]$ grep -A 30 -B 1 domd5 /usr/src/redhat/BUILD/rpm-4.0.4/lib/misc.c int domd5(const char * fn, /*@out@*/ unsigned char * digest, int asAscii) /*@modifies digest, fileSystem @*/ { int rc; FD_t fd = Fopen(fn, "r.ufdio"); unsigned char buf[BUFSIZ]; unsigned char * md5sum = NULL; size_t md5len; if (fd == NULL || Ferror(fd)) { if (fd) (void) Fclose(fd); return 1; } fdInitDigest(fd, PGPHASHALGO_MD5, 0); while ((rc = Fread(buf, sizeof(buf[0]), sizeof(buf), fd)) > 0) {}; fdFiniDigest(fd, PGPHASHALGO_MD5, (void **)&md5sum, &md5len, asAscii); if (Ferror(fd)) rc = 1; (void) Fclose(fd); if (!rc) memcpy(digest, md5sum, md5len); md5sum = _free(md5sum); return rc; }
Yup. The comparison is between a binary and a hex md5 string, the asAscii arg to domd5 in the call is what's wrong, the "update digest" function is buried deep in librpmio underneath the Fread(). This is fixed in rpm-4.0.4-7x.18 from Red Hat 7.3. And apologies for not responding sooner on rpm-list.
Thanks for the answer. Is there going to be an update to the RPM versions for 7.x (x < 3)?
rpm-4.1 will probably be the answer, coming soon.
Are there any reasons to not use the RH7.3 version of RPM with RH7.1 and 7.2 systems?