Merge pull request #2930 from testssl/fix_2929

Fix date parsing bc of locale problem
This commit is contained in:
Dirk Wetter 2025-10-30 15:54:23 +01:00 committed by GitHub
commit 0b9715c239
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -476,11 +476,12 @@ declare TLS13_OSSL_CIPHERS="TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CH
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
# Ubuntu >= 25.10
HAS_GNUDATE=true
elif date -r 735275209 2>&1 | grep -q "No such file"; then
elif LC_ALL=C 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
@ -492,6 +493,7 @@ fi
date -j -f '%s' 1234567 >/dev/null 2>&1 && \
HAS_FREEBSDDATE=true
echo A | sed -E 's/A//' >/dev/null 2>&1 && \
declare -r HAS_SED_E=true || \
declare -r HAS_SED_E=false