summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2024-01-10 21:52:33 +0100
committerRicardo Wurmus <rekado@elephly.net>2024-01-10 21:52:33 +0100
commitdb7488a7fbd829d25b0b5c5e53b1c680b67832b1 (patch)
treedeefcd2b7383f5dbc935dbb8b15e0394baa5c917 /gnu/packages
parent6c453e04b810a45f896cf710b99824dc56aaa403 (diff)
downloadguix-db7488a7fbd829d25b0b5c5e53b1c680b67832b1.tar.gz
gnu: openjdk9: Fix time bomb in ‘GenerateCurrencyData.java’.
Fixes <https://issues.guix.gnu.org/68333>, as well.
This is a companion to commit 5c0f77f4241c9beac0c82deae946bfdc70b49ff0.

* gnu/packages/java.scm (openjdk9)[source]: Add patch.
* gnu/packages/patches/openjdk-currency-time-bomb.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Change-Id: I45ca1fe5bad922307eba64d46a330a8f233c0f55
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/java.scm3
-rw-r--r--gnu/packages/patches/openjdk-currency-time-bomb.patch13
2 files changed, 15 insertions, 1 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index ded73bc461..40d777089a 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -880,7 +880,8 @@ new Date();"))
                (base32
                 "1v92nzdqx07c35x945awzir4yk0fk22vky6fpp8mq9js930sxsz0"))
               (patches (search-patches "openjdk-9-pointer-comparison.patch"
-                                       "openjdk-9-setsignalhandler.patch"))))
+                                       "openjdk-9-setsignalhandler.patch"
+                                       "openjdk-currency-time-bomb.patch"))))
     (build-system gnu-build-system)
     (outputs '("out" "jdk" "doc"))
     (arguments
diff --git a/gnu/packages/patches/openjdk-currency-time-bomb.patch b/gnu/packages/patches/openjdk-currency-time-bomb.patch
new file mode 100644
index 0000000000..7738eb1595
--- /dev/null
+++ b/gnu/packages/patches/openjdk-currency-time-bomb.patch
@@ -0,0 +1,13 @@
+Fix a time bomb present in the OpenJDK tools.
+
+--- a/jdk/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java
++++ b/jdk/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java
+@@ -285,7 +285,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;