Lynis - Security auditing tool for Linux, macOS, and UNIX-based systems. Assists with compliance testing (HIPAA/ISO27001/PCI DSS) and system hardening. Agentless, and installation optional.
The test for TraceEnable in Apache (HTTP-6660) has a comparison that is invalid in Dash (the default for /bin/sh in Debian-based distros). This is due to the way it does the string comparisons to try to compensate for an empty string (are there still shells around that need to do that?).
_Line 325 in include/testswebservers:
TRACEENABLED_SETTING=$( echo ${TRACEENABLE} | tr 'A-Z' 'a-z' )
if [ x${TRACEENABLED_SETTING} == x'off' ]; then
...
else
...
fi
It leads to this error:
./lynis: 326: [: xoff: unexpected operator
Since I'm not sure which old/obscure shells out there can't process an empty string as a parameter when in quotes, I kept the extra "x" and just wrapped the quotes properly.
Version
Describe the bug
The test for TraceEnable in Apache (HTTP-6660) has a comparison that is invalid in Dash (the default for /bin/sh in Debian-based distros). This is due to the way it does the string comparisons to try to compensate for an empty string (are there still shells around that need to do that?).
_Line 325 in include/testswebservers:
It leads to this error:
Since I'm not sure which old/obscure shells out there can't process an empty string as a parameter when in quotes, I kept the extra "x" and just wrapped the quotes properly.
PR is here: #1536