Adds additional message when checksums mismatch during an update

This commit is contained in:
erwanlr
2020-03-08 20:48:01 +01:00
parent a1467f8dac
commit 0b005477c1
2 changed files with 13 additions and 1 deletions

View File

@@ -148,7 +148,7 @@ module WPScan
create_backup(filename) create_backup(filename)
dl_checksum = download(filename) dl_checksum = download(filename)
raise "#{filename}: checksums do not match" unless dl_checksum == db_checksum raise Error::ChecksumsMismatch, filename unless dl_checksum == db_checksum
updated << filename updated << filename
rescue StandardError => e rescue StandardError => e

View File

@@ -8,5 +8,17 @@ module WPScan
'Update required, you can not run a scan if a database file is missing.' 'Update required, you can not run a scan if a database file is missing.'
end end
end end
class ChecksumsMismatch < Standard
attr_reader :db_file
def initialize(db_file)
@db_file = db_file
end
def to_s
"#{db_file}: checksums do not match. Please try again in a few minutes."
end
end
end end
end end