From 5c0f77f4241c9beac0c82deae946bfdc70b49ff0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 10 Jan 2024 15:27:47 +0100 Subject: gnu: icedtea: Fix time bomb in ‘GenerateCurrencyData.java’. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . * gnu/packages/java.scm (icedtea-7)[drop]: Add optional ‘patches’ parameter and honor it. [native-inputs]: Add patch for “jdk-drop”. (icedtea-8): Likewise. * gnu/packages/patches/jdk-currency-time-bomb.patch, gnu/packages/patches/jdk-currency-time-bomb2.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. Change-Id: I3b4cf562ce4bedb87ce0e7c289e431fbb0dbb6f8 --- gnu/packages/patches/jdk-currency-time-bomb.patch | 13 +++++++++++++ gnu/packages/patches/jdk-currency-time-bomb2.patch | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 gnu/packages/patches/jdk-currency-time-bomb.patch create mode 100644 gnu/packages/patches/jdk-currency-time-bomb2.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/jdk-currency-time-bomb.patch b/gnu/packages/patches/jdk-currency-time-bomb.patch new file mode 100644 index 0000000000..8e6bce6fcd --- /dev/null +++ b/gnu/packages/patches/jdk-currency-time-bomb.patch @@ -0,0 +1,13 @@ +Fix a time bomb present in the jdk "drop" of IcedTea. + +--- a/make/tools/src/build/tools/generatecurrencydata/GenerateCurrencyData.java ++++ b/make/tools/src/build/tools/generatecurrencydata/GenerateCurrencyData.java +@@ -284,7 +284,7 @@ public class GenerateCurrencyData { + String timeString = currencyInfo.substring(4, length - 4); + long time = format.parse(timeString).getTime(); + if (Math.abs(time - System.currentTimeMillis()) > ((long) 10) * 365 * 24 * 60 * 60 * 1000) { +- throw new RuntimeException("time is more than 10 years from present: " + time); ++ System.err.println("note: time is more than 10 years from \"present\": " + time); + } + specialCaseCutOverTimes[specialCaseCount] = time; + specialCaseOldCurrencies[specialCaseCount] = oldCurrency; diff --git a/gnu/packages/patches/jdk-currency-time-bomb2.patch b/gnu/packages/patches/jdk-currency-time-bomb2.patch new file mode 100644 index 0000000000..94454626c4 --- /dev/null +++ b/gnu/packages/patches/jdk-currency-time-bomb2.patch @@ -0,0 +1,13 @@ +Fix a time bomb present in the jdk "drop" of IcedTea 8. + +--- a/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java ++++ b/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java +@@ -284,7 +284,7 @@ public class GenerateCurrencyData { + String timeString = currencyInfo.substring(4, length - 4); + long time = format.parse(timeString).getTime(); + if (Math.abs(time - System.currentTimeMillis()) > ((long) 10) * 365 * 24 * 60 * 60 * 1000) { +- throw new RuntimeException("time is more than 10 years from present: " + time); ++ System.err.println("note: time is more than 10 years from \"present\": " + time); + } + specialCaseCutOverTimes[specialCaseCount] = time; + specialCaseOldCurrencies[specialCaseCount] = oldCurrency; -- cgit v1.2.3