guix/gnu/packages/patches/jdk-currency-time-bomb.patch
Ludovic Courtès 5c0f77f424
gnu: icedtea: Fix time bomb in ‘GenerateCurrencyData.java’.
Fixes <https://issues.guix.gnu.org/68333>.

* 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
2024-01-10 16:42:03 +01:00

13 lines
855 B
Diff

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;