diff options
Diffstat (limited to 'include/tests_printers_spools')
-rw-r--r-- | include/tests_printers_spools | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/include/tests_printers_spools b/include/tests_printers_spools index ec64bc11..cfb1a6f3 100644 --- a/include/tests_printers_spools +++ b/include/tests_printers_spools @@ -5,7 +5,7 @@ # Lynis # ------------------ # -# Copyright 2007-2015, Michael Boelen, CISOfy (michael.boelen@cisofy.com) +# Copyright 2007-2016, Michael Boelen, CISOfy (michael.boelen@cisofy.com) # Web site: https://cisofy.com # # Lynis comes with ABSOLUTELY NO WARRANTY. This is free software, and you are @@ -38,22 +38,22 @@ # Description : Check printcap file consistency Register --test-no PRNT-2302 --os FreeBSD --weight L --network NO --description "Check for available accounting information" if [ ${SKIPTEST} -eq 0 ]; then - logtext "Test: Searching /usr/sbin/chkprintcap" + LogText "Test: Searching /usr/sbin/chkprintcap" if [ ! -f /usr/sbin/chkprintcap ]; then Display --indent 2 --text "- Checking chkprintcap" --result "NOT FOUND" --color WHITE - logtext "Result: /usr/sbin/chkprintcap NOT found, test skipped." + LogText "Result: /usr/sbin/chkprintcap NOT found, test skipped." else - logtext "Result: /usr/sbin/chkprintcap found" + LogText "Result: /usr/sbin/chkprintcap found" FIND=`/usr/sbin/chkprintcap > /dev/null ; echo $?` # Only an exit code of zero should come back. Use string instead of integer, due unexpected trash if [ "${FIND}" = "0" ]; then Display --indent 2 --text "- Integrity check of printcap file" --result OK --color GREEN - logtext "Result: chkprintcap did NOT gave any warnings" + LogText "Result: chkprintcap did NOT gave any warnings" else Display --indent 2 --text "- Integrity check of printcap file" --result WARNING --color RED ReportSuggestion ${TEST_NO} "Run chkprintcap manually to test printcap file" - logtext "Output from chkprintcap: ${FIND}" - logtext "Run chkprintcap and check the /etc/printcap file." + LogText "Output from chkprintcap: ${FIND}" + LogText "Run chkprintcap and check the /etc/printcap file." fi fi fi @@ -64,16 +64,16 @@ # Description : Check cupsd status Register --test-no PRNT-2304 --weight L --network NO --description "Check cupsd status" if [ ${SKIPTEST} -eq 0 ]; then - logtext "Test: Checking cupsd status" + LogText "Test: Checking cupsd status" #FIND=`${PSBINARY} ax | grep "cupsd" | grep -v "grep" | grep -v apcupsd` IsRunning cupsd if [ ${RUNNING} -eq 1 ]; then Display --indent 2 --text "- Checking cups daemon" --result RUNNING --color GREEN - logtext "Result: cups daemon running" + LogText "Result: cups daemon running" CUPSD_RUNNING=1; PRINTING_DAEMON="cups" else Display --indent 2 --text "- Checking cups daemon" --result "NOT FOUND" --color WHITE - logtext "Result: cups daemon not running, cups daemon tests skipped" + LogText "Result: cups daemon not running, cups daemon tests skipped" fi fi # @@ -84,21 +84,21 @@ if [ ${CUPSD_RUNNING} -eq 1 ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi Register --test-no PRNT-2306 --preqs-met ${PREQS_MET} --weight L --network NO --description "Check CUPSd configuration file" if [ ${SKIPTEST} -eq 0 ]; then - logtext "Test: Searching cupsd configuration file" + LogText "Test: Searching cupsd configuration file" for I in ${CUPSD_CONFIG_LOCS}; do if [ -f ${I}/cupsd.conf ]; then CUPSD_CONFIG_FILE="${I}/cupsd.conf" - logtext "Result: found ${CUPSD_CONFIG_FILE}" + LogText "Result: found ${CUPSD_CONFIG_FILE}" fi done if [ ! "${CUPSD_CONFIG_FILE}" = "" ]; then Display --indent 2 --text "- Checking CUPS configuration file" --result OK --color GREEN - logtext "Result: configuration file found (${CUPSD_CONFIG_FILE})" + LogText "Result: configuration file found (${CUPSD_CONFIG_FILE})" CUPSD_FOUND=1 else Display --indent 2 --text "- Checking CUPS configuration file" --result "NOT FOUND" --color RED - logtext "Result: configuration file not found" - logtext "Development: no CUPS configuration file found" + LogText "Result: configuration file not found" + LogText "Development: no CUPS configuration file found" fi fi # @@ -110,9 +110,9 @@ if [ ${CUPSD_FOUND} -eq 1 ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi Register --test-no PRNT-2307 --preqs-met ${PREQS_MET} --weight L --network NO --description "Check CUPSd configuration file permissions" if [ ${SKIPTEST} -eq 0 ]; then - logtext "Test: Checking CUPS configuration file permissions" + LogText "Test: Checking CUPS configuration file permissions" FIND=`ls -l ${CUPSD_CONFIG_FILE} | cut -c 2-10` - logtext "Result: found ${FIND}" + LogText "Result: found ${FIND}" if [ "${FIND}" = "r--------" -o "${FIND}" = "rw-------" -o "${FIND}" = "rw-r-----" -o "${FIND}" = "rw-rw----" ]; then Display --indent 4 --text "- File permissions" --result "OK" --color GREEN AddHP 1 1 @@ -132,11 +132,11 @@ if [ ${SKIPTEST} -eq 0 ]; then FOUND=0 # Checking network addresses - logtext "Test: Checking CUPS daemon listening network addresses" + LogText "Test: Checking CUPS daemon listening network addresses" FIND=`grep "^Listen" ${CUPSD_CONFIG_FILE} | grep -v "/" | awk '{ print $2 }'` N=0 for I in ${FIND}; do - logtext "Found network address: ${I}" + LogText "Found network address: ${I}" N=`expr ${N} + 1` FOUND=1 done @@ -147,33 +147,33 @@ # Check if daemon is only running on localhost if [ ${N} -eq 1 ]; then if [ "${FIND}" = "localhost:631" -o "${FIND}" = "127.0.0.1:631" ]; then - logtext "Result: CUPS daemon only running on localhost" + LogText "Result: CUPS daemon only running on localhost" AddHP 2 2 else - logtext "Result: CUPS daemon running on one or more interfaces (not limited to localhost)" + LogText "Result: CUPS daemon running on one or more interfaces (not limited to localhost)" ReportSuggestion ${TEST_NO} "Check CUPS configuration if it really needs to listen on the network" AddHP 1 2 fi else - logtext "Result: CUPS daemon is running on several network addresses" + LogText "Result: CUPS daemon is running on several network addresses" ReportSuggestion ${TEST_NO} "Check CUPS configuration if it really needs to run on several network addresses" AddHP 1 2 fi # Checking sockets - logtext "Test: Checking cups daemon listening sockets" + LogText "Test: Checking cups daemon listening sockets" FIND=`grep "^Listen" ${CUPSD_CONFIG_FILE} | grep "/" | awk '{ print $2 }'` for I in ${FIND}; do - logtext "Found socket address: ${I}" + LogText "Found socket address: ${I}" N=`expr ${N} + 1` done if [ ${N} -eq 0 ]; then Display --indent 2 --text "- Checking CUPS addresses/sockets" --result "NONE" --color WHITE - logtext "Result: no addresses found on which CUPS daemon is listening" + LogText "Result: no addresses found on which CUPS daemon is listening" else Display --indent 2 --text "- Checking CUPS addresses/sockets" --result "FOUND" --color GREEN - logtext "Result: CUPS daemon is listening on network/socket" + LogText "Result: CUPS daemon is listening on network/socket" fi fi # @@ -183,15 +183,15 @@ # Description : Check lpd status Register --test-no PRNT-2314 --weight L --network NO --description "Check lpd status" if [ ${SKIPTEST} -eq 0 ]; then - logtext "Test: Checking lpd status" + LogText "Test: Checking lpd status" IsRunning lpd if [ ${RUNNING} -eq 1 ]; then Display --indent 2 --text "- Checking lp daemon" --result RUNNING --color GREEN - logtext "Result: lp daemon running" + LogText "Result: lp daemon running" LPD_RUNNING=1; PRINTING_DAEMON="lp" else Display --indent 2 --text "- Checking lp daemon" --result "NOT RUNNING" --color WHITE - logtext "Result: lp daemon not running" + LogText "Result: lp daemon not running" AddHP 4 4 fi fi @@ -214,21 +214,21 @@ # Description : Check /etc/qconfig file Register --test-no PRNT-2316 --os AIX --weight L --network NO --description "Checking /etc/qconfig file" if [ ${SKIPTEST} -eq 0 ]; then - logtext "Test: Checking /etc/qconfig" + LogText "Test: Checking /etc/qconfig" QDAEMON_CONFIG_FILE="/etc/qconfig" FileIsReadable ${QDAEMON_CONFIG_FILE} if [ ${CANREAD} -eq 1 ]; then FIND=`grep -v "^\*" ${QDAEMON_CONFIG_FILE} | egrep "backend|device"` if [ ! "${FIND}" = "" ]; then - logtext "Result: printers are defined in ${QDAEMON_CONFIG_FILE}" + LogText "Result: printers are defined in ${QDAEMON_CONFIG_FILE}" Display --indent 2 --text "- Checking /etc/qconfig file" --result FOUND --color GREEN QDAEMON_CONFIG_ENABLED=1 else - logtext "Result: ${QDAEMON_CONFIG_FILE} is empty. No printers are defined" + LogText "Result: ${QDAEMON_CONFIG_FILE} is empty. No printers are defined" Display --indent 2 --text "- Checking /etc/qconfig file" --result EMPTY --color WHITE fi else - logtext "Result: Can not read ${QDAEMON_CONFIG_FILE} (no permission)" + LogText "Result: Can not read ${QDAEMON_CONFIG_FILE} (no permission)" fi fi # @@ -238,19 +238,19 @@ # Description : Check qdaemon printer spooler status Register --test-no PRNT-2418 --os AIX --weight L --network NO --description "Checking qdaemon printer spooler status" if [ ${SKIPTEST} -eq 0 ]; then - logtext "Test: Checking qdaemon status" + LogText "Test: Checking qdaemon status" IsRunning qdaemon if [ ${RUNNING} -eq 1 ]; then - logtext "Result: qdaemon daemon running" + LogText "Result: qdaemon daemon running" Display --indent 2 --text "- Checking qdaemon daemon" --result RUNNING --color GREEN QDAEMON_RUNNING=1; PRINTING_DAEMON="qdaemon" else if [ ${QDAEMON_CONFIG_ENABLED} -eq 1 ]; then - logtext "Result: qdaemon daemon not running" + LogText "Result: qdaemon daemon not running" Display --indent 2 --text "- Checking qdaemon daemon" --result "NOT RUNNING" --color RED ReportSuggestion ${TEST_NO} "Activate print spooler daemon (qdaemon) in order to process print jobs" else - logtext "Result: qdaemon daemon not running" + LogText "Result: qdaemon daemon not running" Display --indent 2 --text "- Checking qdaemon daemon" --result "NOT RUNNING" --color WHITE fi fi @@ -262,7 +262,7 @@ # Description : Checking old print jobs Register --test-no PRNT-2420 --os AIX --weight L --network NO --description "Checking old print jobs" if [ ${SKIPTEST} -eq 0 ]; then - logtext "Test: Checking old print jobs" + LogText "Test: Checking old print jobs" DirectoryExists /var/spool/lpd/qdir if [ ${DIRECTORY_FOUND} -eq 1 ]; then FIND=`find /var/spool/lpd/qdir -type f -mtime +1 2> /dev/null | sed 's/ /!space!/g'` @@ -270,15 +270,15 @@ N=0 for I in ${FIND}; do FILE=`echo ${I} | sed 's/!space!/ /g'` - logtext "Found old print job: ${FILE}" + LogText "Found old print job: ${FILE}" N=`expr ${N} + 1` done - logtext "Result: Found ${N} old print jobs in /var/spool/lpd/qdir" + LogText "Result: Found ${N} old print jobs in /var/spool/lpd/qdir" Display --indent 4 --text "- Checking old print jobs" --result FOUND --color YELLOW ReportSuggestion ${TEST_NO} "Check old print jobs in /var/spool/lpd/qdir to prevent new jobs from being processed" - logtext "Risk: Failed or defunct print jobs can occupy a lot of space and in some cases, prevent new jobs from being processed" + LogText "Risk: Failed or defunct print jobs can occupy a lot of space and in some cases, prevent new jobs from being processed" else - logtext "Result: Old print jobs not found in /var/spool/lpd/qdir" + LogText "Result: Old print jobs not found in /var/spool/lpd/qdir" Display --indent 4 --text "- Checking old print jobs" --result "NONE" --color GREEN fi fi @@ -287,10 +287,10 @@ ################################################################################# # -report "printing_daemon=${PRINTING_DAEMON}" +Report "printing_daemon=${PRINTING_DAEMON}" wait_for_keypress # #================================================================================ -# Lynis - Copyright 2007-2015, Michael Boelen, CISOfy - https://cisofy.com +# Lynis - Copyright 2007-2016, Michael Boelen, CISOfy - https://cisofy.com |