From 0607cb5da1bbe61cd132499082a62bbbc54c8dfd Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Wed, 21 Mar 2018 14:03:00 -0400 Subject: [PATCH setup] Give a fatal error on a checksum failure during install This only affects local installs, where the hash of an archive is not checked until we reach do_install_thread(). At this point it seems too late to recover safely. --- install.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/install.cc b/install.cc index 37dea6f..b5adcc6 100644 --- a/install.cc +++ b/install.cc @@ -850,7 +850,15 @@ do_install_thread (HINSTANCE h, HWND owner) } catch (Exception *e) { - yesno (owner, IDS_SKIP_PACKAGE, e->what()); + // We used to give the user a yes/no option to skip this + // package (with "no" meaning install it even though the + // archive is corrupt), but both options could damage the + // user's system. In the absence of a safe way to recover, we + // just bail out. + if (e->errNo() == APPERR_CORRUPT_PACKAGE) + fatal (owner, IDS_CORRUPT_PACKAGE, version.Name().c_str()); + // Unexpected exception. + throw e; } { md5sum_total_bytes_sofar += version.source()->size; -- 2.16.2