mirror of https://github.com/CISOfy/lynis.git
Improved PackageIsInstalled function and its usage
This commit is contained in:
parent
256bc1da0f
commit
fd8b1e790d
|
@ -1719,7 +1719,7 @@
|
|||
output=$(${DNFBINARY} --quiet --cacheonly --noplugins --assumeno info --installed ${package} > /dev/null 2>&1)
|
||||
exit_code=$?
|
||||
elif [ ! -z "${DPKGBINARY}" ]; then
|
||||
output=$(${DPKGBINARY} -l ${package} > /dev/null 2>&1)
|
||||
output=$(${DPKGBINARY} -l ${package} 2> /dev/null | ${GREPBINARY} "^ii")
|
||||
exit_code=$?
|
||||
elif [ ! -z "${EQUERYBINARY}" ]; then
|
||||
output=$(${EQUERYBINARY} --quiet ${package} > /dev/null 2>&1)
|
||||
|
|
|
@ -138,8 +138,7 @@
|
|||
if [ ${SKIPTEST} -eq 0 ]; then
|
||||
# Check for installed xinetd daemon
|
||||
LogText "Test: Checking for installed xinetd daemon"
|
||||
PackageIsInstalled xinetd
|
||||
if [ $? -eq 0 ]; then
|
||||
if PackageIsInstalled "xinetd"; then
|
||||
LogText "Result: xinetd is installed"
|
||||
Display --indent 2 --text "- Installed xinetd package" --result "${STATUS_FOUND}" --color YELLOW
|
||||
ReportSuggestion ${TEST_NO} "If there are no xinetd services required, it is recommended that the daemon be removed"
|
||||
|
@ -277,7 +276,7 @@
|
|||
FOUND=0
|
||||
PACKAGES="tcp_wrappers tcpd"
|
||||
for PACKAGE in ${PACKAGES}; do
|
||||
if PackageIsInstalled ${PACKAGE}; then FOUND=1; fi
|
||||
if PackageIsInstalled "${PACKAGE}"; then LogText "Package '${PACKAGE}' is installed"; FOUND=1; fi
|
||||
done
|
||||
if [ ${FOUND} -eq 1 ]; then
|
||||
LogText "Result: tcp_wrappers is installed"
|
||||
|
@ -299,7 +298,7 @@
|
|||
FOUND=0
|
||||
PACKAGES="rsh rsh-client rsh-redone-client"
|
||||
for PACKAGE in ${PACKAGES}; do
|
||||
if PackageIsInstalled "${PACKAGE}"; then FOUND=1; fi
|
||||
if PackageIsInstalled "${PACKAGE}"; then LogText "Package '${PACKAGE}' is installed"; FOUND=1; fi
|
||||
done
|
||||
if [ ${FOUND} -eq 1 ]; then
|
||||
LogText "Result: rsh client is installed"
|
||||
|
@ -356,7 +355,7 @@
|
|||
FOUND=0
|
||||
PACKAGES="rsh-server rsh-redone-server"
|
||||
for PACKAGE in ${PACKAGES}; do
|
||||
if PackageIsInstalled "${PACKAGE}"; then FOUND=1; fi
|
||||
if PackageIsInstalled "${PACKAGE}"; then LogText "Package '${PACKAGE}' is installed"; FOUND=1; fi
|
||||
done
|
||||
if [ ${FOUND} -eq 1 ]; then
|
||||
LogText "Result: rsh server is installed"
|
||||
|
@ -377,7 +376,8 @@
|
|||
if [ ${SKIPTEST} -eq 0 ]; then
|
||||
# Check if telnet client is installed
|
||||
LogText "Test: Checking if telnet client is installed"
|
||||
if PackageIsInstalled "${PACKAGE}"; then FOUND=1; fi
|
||||
if PackageIsInstalled "${PACKAGE}"; then LogText "Package '${PACKAGE}' is installed"; FOUND=1; fi
|
||||
|
||||
if [ ${FOUND} -eq 1 ]; then
|
||||
LogText "Result: telnet client is installed"
|
||||
Display --indent 2 --text "- Installed telnet client package" --result "${STATUS_FOUND}" --color YELLOW
|
||||
|
@ -400,7 +400,7 @@
|
|||
FOUND=0
|
||||
PACKAGES="telnetd telnet-server"
|
||||
for PACKAGE in ${PACKAGES}; do
|
||||
if PackageIsInstalled "${PACKAGE}"; then FOUND=1; fi
|
||||
if PackageIsInstalled "${PACKAGE}"; then LogText "Package '${PACKAGE}' is installed"; FOUND=1; fi
|
||||
done
|
||||
if [ ${FOUND} -eq 1 ]; then
|
||||
LogText "Result: telnet server is installed"
|
||||
|
|
Loading…
Reference in New Issue