[Rt-commit] rt branch, 4.0/make-jsmin-target, updated. rt-4.0.2-4-g3771e77

Thomas Sibley trs at bestpractical.com
Thu Aug 18 14:48:26 EDT 2011


The branch, 4.0/make-jsmin-target has been updated
       via  3771e7743f8fb10ddc3cbd243e7289c8c1dd3fd7 (commit)
      from  7d5b33bead9469e72756585e4c9935bb9486f845 (commit)

Summary of changes:
 Makefile.in |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 3771e7743f8fb10ddc3cbd243e7289c8c1dd3fd7
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Aug 18 14:45:17 2011 -0400

    Host jsmin ourselves and check a SHA1 sum to avoid compiling unexpected code

diff --git a/Makefile.in b/Makefile.in
index e50a0c9..6a1152d 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -528,9 +528,10 @@ vessel-import: build-snapshot
      --skip cpan-capitalization,cpan-mod_perl,cpan-Encode,cpan-PPI,cpan-Test-Exception-LessClever,cpan-Test-Manifest,cpan-Test-Object,cpan-Test-Pod,cpan-Test-Requires,cpan-Test-SubCalls,cpan-Test-cpan-Tester,cpan-Test-Warn --skip-all-recommends
 	mv $(VESSEL)/scripts/RT/build  $(VESSEL)/scripts/RT/build.pl
 
-JSMIN_URL = http://www.crockford.com/javascript/jsmin.c
+JSMIN_URL = http://download.bestpractical.com/mirror/jsmin-2011-01-22.c
+JSMIN_SHA = 8a6b3b980a52c028eb73aee4a82ebe060c1ee854
 
-jsmin: jsmin-checkcc jsmin-fetch jsmin-confirm jsmin-build jsmin-install
+jsmin: jsmin-checkcc jsmin-fetch jsmin-verify jsmin-confirm jsmin-build jsmin-install
 	@echo ""
 	@echo "To configure RT to use jsmin, add the following line to $(DESTDIR)$(RT_ETC_PATH)/RT_SiteConfig.pm:"
 	@echo ""
@@ -557,6 +558,11 @@ jsmin-fetch:
 	@$(PERL) -MLWP::Simple -e 'exit not is_success(getstore("$(JSMIN_URL)", "jsmin.c"))' \
 		|| (echo "Failed to download $(JSMIN_URL)" && exit 1)
 
+jsmin-verify:
+	@$(PERL) -MDigest::SHA -e \
+		'exit not Digest::SHA->new(1)->addfile("jsmin.c")->hexdigest eq "$(JSMIN_SHA)"' \
+		|| (echo "Verification of jsmin.c failed! Possible man in the middle?" && exit 1)
+
 jsmin-build:
 	$(CC) -o jsmin jsmin.c
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list