Skip to content

Commit df652c0

Browse files
committed
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 .
1 parent a3372ed commit df652c0

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

testssl.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,11 +469,15 @@ HAS_GNUDATE=false
469469
HAS_FREEBSDDATE=false
470470
HAS_OPENBSDDATE=false
471471
if date -d @735275209 >/dev/null 2>&1; then
472-
if date -r @735275209 >/dev/null 2>&1; then
472+
if date -r @735275209 >/dev/null 2>&1; then
473+
# Ubuntu >= 25.10
474+
HAS_GNUDATE=true
475+
elif date -r 735275209 2>&1 | grep -q "No such file"; then
476+
# e.g. Debian 24.04, Debian 11-13
477+
HAS_GNUDATE=true
478+
elif date -r 735275209 >/dev/null 2>&1; then
473479
# It can't do any conversion from a plain date output.
474480
HAS_OPENBSDDATE=true
475-
else
476-
HAS_GNUDATE=true
477481
fi
478482
fi
479483
# FreeBSD and OS X date(1) accept "-f inputformat", so do newer OpenBSD versions >~ 6.6.

0 commit comments

Comments
 (0)