[Rpm-maint] [Suse patch] Verbose lstat failure message in verification

Panu Matilainen pmatilai at redhat.com
Tue May 22 12:24:00 UTC 2007


Another "looks harmless enough but..." patch. The "but" here is that it 
doesn't actually do anything as is :)

---

Tell user the reason why the lstat failed in a verify operation.

--- ./lib/verify.c.orig	2005-12-15 15:17:41.000000000 +0000
+++ ./lib/verify.c	2005-12-15 15:24:48.000000000 +0000
@@ -327,6 +327,10 @@ static int verifyHeader(QVA_t qva, const
  			 (fileAttrs & RPMFILE_README)	? 'r' : ' '),
  			rpmfiFN(fi));
  		te += strlen(te);
+		if ((rc & RPMVERIFY_LSTATFAIL) != 0) {
+		    sprintf(te, " (%s)", strerror(errno));
+		    te += strlen(te);
+		}
  		ec = rc;
  	    }
  	} else if (verifyResult || rpmIsVerbose()) {

To actually do something, that would need to be:

@@ -298,6 +299,10 @@ static int verifyHeader(QVA_t qva, const
                          (fileAttrs & RPMFILE_README)   ? 'r' : ' '),
                         rpmfiFN(fi));
                 te += strlen(te);
+               if ((verifyResult & RPMVERIFY_LSTATFAIL) != 0) {
+                   sprintf(te, " (%s)", strerror(errno));
+                   te += strlen(te);
+               }
                 ec = rc;
             }
         } else if (verifyResult || rpmIsVerbose()) {


So now you get some actual results (first is stock 4.4.2, latter with 
this patch):

[pmatilai at dhcp115 tst-rpm]$ rpm -V fedora-release
missing     /etc/redhat-release
..5....T c /etc/yum.repos.d/fedora-development.repo
[pmatilai at dhcp115 tst-rpm]$ ./rpmq -V fedora-release
missing     /etc/redhat-release (No such file or directory)
..5....T c /etc/yum.repos.d/fedora-development.repo

I can't find any comment related to this in the suse rpm changelog, 
anybody remember what the original case was? I wouldn't want to change the 
verification output as any number of scripts might be parsing it, and that 
extra output has potential to confuse things. Especially since nobody 
seems to be missing this feature since it wasn't working to begin with :) 
(dunno if the verify api has changed so it *used* to work at some point 
in history but got broken in a merge)

 	- Panu -



More information about the Rpm-maint mailing list