Bug 830537 - Preupgrade should verify packages after download
Preupgrade should verify packages after download
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: preupgrade (Show other bugs)
16
All Linux
unspecified Severity medium
: ---
: ---
Assigned To: Richard Hughes
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-10 09:17 EDT by Adam Pribyl
Modified: 2013-02-13 09:46 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-13 09:46:32 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Adam Pribyl 2012-06-10 09:17:33 EDT
Description of problem:
Once preupgrade downloads a package for following upgrade process it should verify its checksum before it reboots for installation. This should help to avoid problems like bug #650854 when installation is interrupted in the middle due to package being corrupted.

It should be as simple as running 	
rpm --checksig package
after each package is downloaded.

Version-Release number of selected component (if applicable):
preupgrade-1.1.10-1.fc16.noarch

How reproducible:
Always when downloaded rpm is currpted.

You may check this problem description at
http://soumya.dgplug.org/?p=100
too.
Comment 1 Adam Pribyl 2012-06-27 14:37:36 EDT
Here is my quick patch to do the package verifycation during the preupgrade download process. I am really not a python guru, just wrote it based on the existing code.

diff -Naur preupgrade-gtk.py.orig preupgrade-gtk.py
--- preupgrade-gtk.py.orig	2011-10-21 16:10:03.000000000 +0200
+++ preupgrade-gtk.py	2012-06-27 20:35:00.881588412 +0200
@@ -553,6 +553,21 @@
         self.dnlProgress.reset(len(downloadpkgs), downloadsize)
         self.dnlProgress.datamode = True
         problems = self.pu.downloadPkgs(downloadpkgs)
+
+        # Step 4ca: verify the downloaded RPMs are OK
+        print _("Verifying packages")
+        self.progress.details(_("Verifying downloaded packages"))
+        for po in downloadpkgs:
+            if hasattr(po, 'pkgtype') and po.pkgtype == 'local':
+                continue
+
+            local = po.localPkg()
+            if os.path.exists(local):
+                if not self.pu.verifyPkg(local, po, False):
+                    message = _("Package: ") + str(local) + (" corrupted, please delete it and try to run preupgrade again")
+                    raise Exception, message
+                    self.exit_instance(exitcode=1)
+
         del self.pu.tsInfo
 
         # Step 4d: check upgrade sizes now that we've downloaded RPMs
Comment 2 Adam Williamson 2012-06-28 17:33:05 EDT
This could be considered a dupe of https://bugzilla.redhat.com/show_bug.cgi?id=650854 , but that one covers a specific case where package 'corruption' regularly occurs (VirtualBox), so probably best keep them separate. See also https://bugzilla.redhat.com/show_bug.cgi?id=651278 - preupgrade is similarly poor at dealing with network drops, apparently.
Comment 3 Adam Pribyl 2012-06-29 10:58:53 EDT
Thanks for the points. I am modify the patch to complain also at missing package - then all those bug would be solved by my patch - after download finishes, it verifies all the packages that should be downloaded. If not, then exits.. not the best solution, but better than corrupted upgrade.
Comment 4 Fedora End Of Life 2013-01-16 08:52:01 EST
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 5 Fedora End Of Life 2013-02-13 09:46:34 EST
Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.