More informative error message when lstat() in verification fails.
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 23 May 2007 05:40:22 +0000 (08:40 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 23 May 2007 05:40:22 +0000 (08:40 +0300)
Eg when running verification as non-root, it can lead to confusing results
until you realize you didn't have permission to verify the file.

Patch originally from OpenSuSE, slightly modified.

lib/verify.c

index c4b20aa..162a8e5 100644 (file)
@@ -298,6 +298,11 @@ static int verifyHeader(QVA_t qva, const rpmts ts, rpmfi fi)
                         (fileAttrs & RPMFILE_README)   ? 'r' : ' '), 
                        rpmfiFN(fi));
                te += strlen(te);
+               if ((verifyResult & RPMVERIFY_LSTATFAIL) != 0 &&
+                   errno != ENOENT) {
+                   sprintf(te, " (%s)", strerror(errno));
+                   te += strlen(te);
+               }
                ec = rc;
            }
        } else if (verifyResult || rpmIsVerbose()) {