Fix error reporting on rpm --checksig (rhbz#155079)
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 4 Sep 2007 07:23:54 +0000 (10:23 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 4 Sep 2007 07:23:54 +0000 (10:23 +0300)
lib/rpmchecksig.c

index 54239e2..e37fe36 100644 (file)
@@ -1089,10 +1089,14 @@ int rpmcliSign(rpmts ts, QVA_t qva, const char ** argv)
     while ((arg = *argv++) != NULL) {
        FD_t fd;
 
-       if ((fd = Fopen(arg, "r.ufdio")) == NULL
-        || Ferror(fd)
-        || rpmVerifySignatures(qva, ts, fd, arg))
+       fd = Fopen(arg, "r.ufdio");
+       if (fd == NULL || Ferror(fd)) {
+           rpmError(RPMERR_OPEN, _("%s: open failed: %s\n"), 
+                    arg, Fstrerror(fd));
+           res++;
+       } else if (rpmVerifySignatures(qva, ts, fd, arg)) {
            res++;
+       }
 
        if (fd != NULL) xx = Fclose(fd);
     }