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.
Lines 150 of /usr/share/lynis/include/tests_boot_services contains a test for a non-zero length string which will always return true. Perhaps what was intended was a test for whether the string was a directory, as on line 152?
149 "Solaris")
150 if [ -n "${ROOTDIR}usr/bin/svcs" ]; then
151 SERVICE_MANAGER="SMF (svcs)"
152 elif [ -d "${ROOTDIR}etc/init.d" ]; then
153 SERVICE_MANAGER="SysV Init"
154 fi
Version
Windows 11 running VMware Workstation 17 Player, version 17.6.1
...running Fedora 40, kernel 6.11.3
Lynis version 3.1.2
Output
# shellcheck -s sh -S error /usr/share/lynis/include/*
In /usr/share/lynis/include/tests_boot_services line 150:
if [ -n "${ROOTDIR}usr/bin/svcs" ]; then
^----------^ SC2157 (error): Argument to -n is always true due to literal strings.
It looks like a test option could be incorrect.
Lines 150 of /usr/share/lynis/include/tests_boot_services contains a test for a non-zero length string which will always return true. Perhaps what was intended was a test for whether the string was a directory, as on line 152?
Version
Output # shellcheck -s sh -S error /usr/share/lynis/include/*
In /usr/share/lynis/include/tests_boot_services line 150: if [ -n "${ROOTDIR}usr/bin/svcs" ]; then ^----------^ SC2157 (error): Argument to -n is always true due to literal strings.