Skip to content

Commit df100d9

Browse files
authored
Merge pull request #2913 from testssl/fix_2909
Fix date for Ubuntu >= 25.10
2 parents 80d05c0 + 3353627 commit df100d9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

testssl.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,11 +475,15 @@ HAS_GNUDATE=false
475475
HAS_FREEBSDDATE=false
476476
HAS_OPENBSDDATE=false
477477
if date -d @735275209 >/dev/null 2>&1; then
478-
if date -r @735275209 >/dev/null 2>&1; then
478+
if date -r @735275209 >/dev/null 2>&1; then
479+
# Ubuntu >= 25.10
480+
HAS_GNUDATE=true
481+
elif date -r 735275209 2>&1 | grep -q "No such file"; then
482+
# e.g. Debian 24.04, Debian 11-13
483+
HAS_GNUDATE=true
484+
elif date -r 735275209 >/dev/null 2>&1; then
479485
# It can't do any conversion from a plain date output.
480486
HAS_OPENBSDDATE=true
481-
else
482-
HAS_GNUDATE=true
483487
fi
484488
fi
485489
# FreeBSD and OS X date(1) accept "-f inputformat", so do newer OpenBSD versions >~ 6.6.

0 commit comments

Comments
 (0)