File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -478,14 +478,17 @@ HAS_FREEBSDDATE=false
478478HAS_OPENBSDDATE=false
479479
480480if date -d @735275209 >/dev/null 2>&1; then
481+ # FreeBSD's / MacOS' date doesn't reach this
481482 if date -r @735275209 >/dev/null 2>&1; then
482483 # Ubuntu >= 25.10
483484 HAS_GNUDATE=true
484- elif LC_ALL=C date -r 735275209 2>&1 | grep -q "No such file"; then
485+ # need to make sure we end up in a directory with read permission (see #3009)
486+ elif (cd /; LC_ALL=C date -r 735275209 2>&1 | grep -q "No such file"); then
485487 # e.g. Debian 24.04, Debian 11-13
486488 HAS_GNUDATE=true
489+ # OpenBSD treats this as a reference (as FreeBSD would do it)
487490 elif date -r 735275209 >/dev/null 2>&1; then
488- # It can't do any conversion from a plain date output.
491+ # OpenBSD date can't do any conversion from a plain date output
489492 HAS_OPENBSDDATE=true
490493 fi
491494fi
You can’t perform that action at this time.
0 commit comments