Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2022-02-10 14:03:46 +0300
committerGitHub <noreply@github.com>2022-02-10 14:03:46 +0300
commit0830a745cce4374a61edb28a2298a2aef06764b7 (patch)
tree51e939c4edb61d3799747379238566949737af67
parentcd433e928efe334bbb4b86fb5833f4d6ebd62f28 (diff)
parentf81aff384c19cb3d6e0a7ae51e655721297b28a0 (diff)
Merge pull request #1250 from JensChrG/master
Dont write over FIND variable. Fixes #1021
-rw-r--r--include/tests_printers_spoolers23
1 files changed, 13 insertions, 10 deletions
diff --git a/include/tests_printers_spoolers b/include/tests_printers_spoolers
index 18b88c0c..851b0edd 100644
--- a/include/tests_printers_spoolers
+++ b/include/tests_printers_spoolers
@@ -139,8 +139,18 @@
Register --test-no PRNT-2308 --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Check CUPSd network configuration"
if [ ${SKIPTEST} -eq 0 ]; then
FOUND=0
- # Checking network addresses
+ PORT_FOUND=0
+
LogText "Test: Checking CUPS daemon listening network addresses"
+
+ # Search for Port statement
+ FIND=$(${EGREPBINARY} "^Port 631" ${CUPSD_CONFIG_FILE})
+ if [ -n "${FIND}" ]; then
+ LogText "Result: found CUPS listening on port 631 (most likely all interfaces)"
+ PORT_FOUND=1
+ fi
+
+ # Checking network addresses
FIND=$(${EGREPBINARY} "^(SSL)?Listen" ${CUPSD_CONFIG_FILE} | ${GREPBINARY} -v "/" | ${AWKBINARY} '{ print $2 }')
COUNT=0
for ITEM in ${FIND}; do
@@ -149,17 +159,10 @@
FOUND=1
done
- # Search for Port statement
- FIND=$(${EGREPBINARY} "^Port 631" ${CUPSD_CONFIG_FILE})
- if [ -n "${FIND}" ]; then
- LogText "Result: found CUPS listening on port 631 (most likely all interfaces)"
- FOUND=1
- fi
-
# Check if daemon might be running on localhost
- if [ ${FOUND} -eq 0 ]; then
+ if [ ${FOUND} -eq 0 -a ${PORT_FOUND} -eq 0 ]; then
LogText "Result: CUPS does not look to be listening on a network port"
- elif [ ${COUNT} -eq 1 ]; then
+ elif [ ${COUNT} -eq 1 -a ${PORT_FOUND} -eq 0 ]; then
if [ "${FIND}" = "localhost:631" -o "${FIND}" = "127.0.0.1:631" ]; then
LogText "Result: CUPS daemon only running on localhost"
AddHP 2 2