Skip to content

Commit 9e269f5

Browse files
authored
Merge pull request #2924 from testssl/date_fix_rust-date.3.2
Fix date for Ubuntu >= 25.10 (3.2)
2 parents aeb5e58 + df652c0 commit 9e269f5

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)