Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 938138 - need the ablity to add referer header when downloading SRC_URI
Summary: need the ablity to add referer header when downloading SRC_URI
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Package Manager Specification
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-18 07:07 UTC by microcai
Modified: 2024-08-18 20:10 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description microcai 2024-08-18 07:07:23 UTC
some package file download link need "referer: " header to correctly download the files.

e.g:

https://drivers.pantum.cn/userfiles/files/download/drive/1820/Pantum%20Ubuntu%20Driver%20V1_1_100-1.zip  need curl command flag "--referer https://www.pantum.cn/support/download/driver/" to currectly donwload this file.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2024-08-18 09:30:42 UTC
This is a corner case and I don't think there's a point in adding the complexity (especially that it can't be added without breaking backwards compatibility with PORTAGE_FETCHCOMMAND).  Furthermore, given that upstream deliberately blocks the download, it is legally dubious whether we should officially work around that.  In the end, if we do they might just use a more sophisticated method of blocking direct downloads.
Comment 2 Zac Medico gentoo-dev 2024-08-18 14:51:42 UTC
Our current approach would be to set RESTRICT=fetch for these packages, since the Referer header requirement indicates a lack of permission.
Comment 3 Ulrich Müller gentoo-dev 2024-08-18 19:56:23 UTC
The package manager would have to send a forged referrer header. Pretty sure that this would violate the HTTP standard.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-08-18 20:03:38 UTC
It also, as mgorny suggests, would then get us into an arms race.

While I _do_ think we should sometimes allow things in PMS that we wouldn't want in ::gentoo, I don't think this is one of those times. Way too brittle.
Comment 5 Eli Schwartz gentoo-dev 2024-08-18 20:08:47 UTC
I generally oppose this on the grounds that what you really want is to be able to define your own arbitrary src_fetch function containing handwritten download logic.

There's a lot of use cases for this, independent of whether ::gentoo would have a tree policy banning it. For example, you could fill out a webform and post it in order to get redirected to a one-time download link that is only available after you give your real name, company, and email address and sign up for a newsletter and possibly write a short paragraph describing what your interest in the software is.

Implementing anything that is overly specific to referer feels wrong.