mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-11-22 16:45:16 +01:00
Fix date parsing bc of locale problem
The new block making sure that rust coreutils work properly (PR #2913) introduced a new check in order to determine which date functions to use. The function however parsed only for English error messages ("No such file"). This PR fixes #2929 that for 3.2 by setting LC_ALL to C.
This commit is contained in:
@@ -468,11 +468,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
|
||||
@@ -484,6 +485,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
|
||||
|
||||
Reference in New Issue
Block a user