From df652c05cd030d5b26e0e6f1165f149563309c0b Mon Sep 17 00:00:00 2001 From: Dirk Wetter Date: Sun, 12 Oct 2025 12:20:29 +0200 Subject: [PATCH] Fix date for Ubuntu >= 25.10 (3.2) Ubuntu 25.10 has transitionned from GNU Core-utils to Rust Core-utils. That changes the testing results which date version to use for displaying / conversion of dates like in certificates. Probably more Linux distriutions will follow. See also #2909 . For maintenance reasons it is advised also the stable version will get this patched. For 3.3dev, see #2913 . --- testssl.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/testssl.sh b/testssl.sh index 9b47e4b9..b3ba588d 100755 --- a/testssl.sh +++ b/testssl.sh @@ -469,11 +469,15 @@ HAS_GNUDATE=false HAS_FREEBSDDATE=false HAS_OPENBSDDATE=false if date -d @735275209 >/dev/null 2>&1; then - if date -r @735275209 >/dev/null 2>&1; then + if date -r @735275209 >/dev/null 2>&1; then + # Ubuntu >= 25.10 + HAS_GNUDATE=true + elif date -r 735275209 2>&1 | grep -q "No such file"; then + # e.g. Debian 24.04, Debian 11-13 + HAS_GNUDATE=true + elif date -r 735275209 >/dev/null 2>&1; then # It can't do any conversion from a plain date output. HAS_OPENBSDDATE=true - else - HAS_GNUDATE=true fi fi # FreeBSD and OS X date(1) accept "-f inputformat", so do newer OpenBSD versions >~ 6.6.