Skip to content

[BUG / possible BUG] date not detected when user does not have read permissions on pwd #3009

@richlv

Description

@richlv

General remark

It's much appreciated if you spot bugs and file them! Please keep in mind though that you'd need to enable us to reproduce what you encountered. If otherwise we need to play ping-pong it costs time on our side we'd rather like to spend on the development.

Before you open an issue please check which version you are running and whether it is the latest in stable / dev branch

  • I am running version (git log | head -1 ) from the git repo
  • I am running testssl.sh version 3.2.3 from https://testssl.sh/

Before you open an issue please consult the FAQ and check whether this is a known problem by searching the issues

  • Is related to ...
  • couldn't find anything

Command line to reproduce (or docker command)

sudo -u user /pat/to/testssl/testssl.sh host:port

When run from a directory where target user does not have read permissions, date seems to be misdetected.

Expected behavior

date detected also when pwd is not readable for the user.

Your system (please complete the following information):

  • OS: Oracle Linux Server 8.10
  • Platform: Linux 5.15.0-318.199.3.2.el8uek.x86_64 x86_64
  • OpenSSL + bash: Using OpenSSL 1.0.2-bad (Mar 28 2025) [~183 ciphers] Using bash 4.4.20

Additional context

testssl.sh detects date flavour based on output of various invocations. At https://github.com/testssl/testssl.sh/blob/3.3dev/testssl.sh#L484 , it calls:

LC_ALL=C date -r 735275209 2>&1 | grep -q "No such file"

This usually works as expected, but in cases when the user does not have read permissions for the current directory, GNU date prints:

date: 735275209: Permission denied

Potentially the check could try changing to a well-known directory that should have read permissions, or accept the other error message as well.

Running testssl.sh under some other user with sudo is one usecase where this problem could happen, but there are other cases as well, like running it from integration/automation scripts.

Additionally, please note that bug template suggests to run:

testssl.sh -b 2>/dev/null | grep Using '

Either a single quote is missing before Using, or the trailing space and single quote should be removed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions