pkgcheck icon indicating copy to clipboard operation
pkgcheck copied to clipboard

network: detect suspicious text/html replies to SRC_URI

Open mgorny opened this issue 5 years ago • 1 comments

Given that we had silly servers that give 200 + HTML page on incorrect URL, maybe it would be a good idea to flag text/html and similar responses to SRC_URI, when the URI in question does not look like .html.

mgorny avatar Sep 25 '19 06:09 mgorny

Example ebuild suffering from this:

$ ebuild enemy-territory-etpro-3.2.6-r1.ebuild fetch
Appending /home/mgorny/git/gentoo to PORTDIR_OVERLAY...
>>> Downloading 'http://www.enemyterritory.sk/files/etpro-3_2_6.zip'
--2019-09-28 14:12:39--  http://www.enemyterritory.sk/files/etpro-3_2_6.zip
Resolving www.enemyterritory.sk (www.enemyterritory.sk)... 198.7.58.222
Connecting to www.enemyterritory.sk (www.enemyterritory.sk)|198.7.58.222|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.enemyterritory.sk [following]
--2019-09-28 14:12:41--  http://www.enemyterritory.sk/
Reusing existing connection to www.enemyterritory.sk:80.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘/srv/nfs/common/distfiles/etpro-3_2_6.zip.__download__’

     0K                                      238K=0,2s

2019-09-28 14:12:42 (238 KB/s) - ‘/srv/nfs/common/distfiles/etpro-3_2_6.zip.__download__’ saved [59011]

!!! Fetched file: etpro-3_2_6.zip VERIFY FAILED!
!!! Reason: Filesize does not match recorded size
!!! Got:      59011
!!! Expected: 3698539
Refetching... File renamed to '/srv/nfs/common/distfiles/etpro-3_2_6.zip._checksum_failure_.j0uldgv5'

mgorny avatar Sep 28 '19 12:09 mgorny