More informative error message when lstat() in verification fails.

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.
This commit is contained in:
Panu Matilainen 2007-05-23 08:40:22 +03:00
parent b1c7f449f6
commit d9281caad5
1 changed files with 5 additions and 0 deletions

View 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()) {