Skip to content

Commit 299f083

Browse files
stigtspzakame
authored andcommitted
generate: hotpatch bin/cpanm to use HTTPS endpoints
This commit patches out insecure http endpoints from the fatpacked `bin/cpanm` executable
1 parent 09d0e7d commit 299f083

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

generate.pl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ sub die_with_sample {
9191
url => "https://www.cpan.org/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7047.tar.gz",
9292
# sha256 taken from http://www.cpan.org/authors/id/M/MI/MIYAGAWA/CHECKSUMS
9393
sha256 => "963e63c6e1a8725ff2f624e9086396ae150db51dd0a337c3781d09a994af05a5",
94+
patch => q[perl -pi -E 's{http://(www\.cpan\.org|backpan\.perl\.org|cpan\.metacpan\.org|fastapi\.metacpan\.org|cpanmetadb\.plackperl\.org)}{https://$1}g' bin/cpanm],
9495
},
9596
iosocketssl => {
9697
name => "IO-Socket-SSL-2.085",
@@ -325,7 +326,9 @@ =head1 DESCRIPTION
325326
&& cd /usr/src \
326327
&& curl -fLO {{cpanm_dist_url}} \
327328
&& echo '{{cpanm_dist_sha256}} *{{cpanm_dist_name}}.tar.gz' | sha256sum --strict --check - \
328-
&& tar -xzf {{cpanm_dist_name}}.tar.gz && cd {{cpanm_dist_name}} && perl bin/cpanm . && cd /root \
329+
&& tar -xzf {{cpanm_dist_name}}.tar.gz && cd {{cpanm_dist_name}} \
330+
&& {{cpanm_dist_patch}} \
331+
&& perl bin/cpanm . && cd /root \
329332
&& curl -fLO '{{netssleay_dist_url}}' \
330333
&& echo '{{netssleay_dist_sha256}} *{{netssleay_dist_name}}.tar.gz' | sha256sum --strict --check - \
331334
&& cpanm --from $PWD {{netssleay_dist_name}}.tar.gz \

0 commit comments

Comments
 (0)