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:
authorSiemKorteweg <Siem.Korteweg@qnh.nl>2015-10-10 14:25:14 +0300
committerSiemKorteweg <Siem.Korteweg@qnh.nl>2015-10-10 14:25:14 +0300
commit0c48fc3880551d862063e56a029ce43082df376a (patch)
treed57f59a582b3d457fccd0dad6f32b3513ebf294f /include/tests_kernel
parentc0378f38f517e916b141a8bc5049eb742e66d48f (diff)
Optimized use of cat, grep and awk.
Detection of duplicate entries in /etc/hosts is now more robust. On CentOS7 the SERVICE_MANAGER is detected correctly.
Diffstat (limited to 'include/tests_kernel')
-rw-r--r--include/tests_kernel10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/tests_kernel b/include/tests_kernel
index 495d62bc..7cd49e12 100644
--- a/include/tests_kernel
+++ b/include/tests_kernel
@@ -105,9 +105,9 @@
if [ -f /proc/cpuinfo ]; then
logtext "Result: found /proc/cpuinfo"
logtext "Test: Checking CPU options (XD/NX/PAE)"
- FIND_PAE_NX=`cat /proc/cpuinfo | grep " pae " | grep " nx "`
- FIND_PAE=`cat /proc/cpuinfo | grep " pae "`
- FIND_NX=`cat /proc/cpuinfo | grep " nx "`
+ FIND_PAE_NX=`grep " pae " /proc/cpuinfo | grep " nx "`
+ FIND_PAE=`grep " pae " /proc/cpuinfo`
+ FIND_NX=`grep " nx " /proc/cpuinfo`
FOUND=0
if [ ! "${FIND_PAE_NX}" = "" ]; then
logtext "PAE: Yes"
@@ -380,8 +380,8 @@
if [ -f /etc/security/limits.conf ]; then
logtext "Result: file /etc/security/limits.conf exists"
logtext "Test: Checking if core dumps are disabled in /etc/security/limits.conf"
- FIND1=`cat /etc/security/limits.conf | grep -v "^#" | grep -v "^$" | awk '{ if ($1=="*" && $2=="soft" && $3=="core" && $4=="1") { print "soft core enabled" } }'`
- FIND2=`cat /etc/security/limits.conf | grep -v "^#" | grep -v "^$" | awk '{ if ($1=="*" && $2=="hard" && $3=="core" && $4=="1") { print "hard core enabled" } }'`
+ FIND1=`grep -v "^#" /etc/security/limits.conf | grep -v "^$" | awk '{ if ($1=="*" && $2=="soft" && $3=="core" && $4=="1") { print "soft core enabled" } }'`
+ FIND2=`grep -v "^#" /etc/security/limits.conf | grep -v "^$" | awk '{ if ($1=="*" && $2=="hard" && $3=="core" && $4=="1") { print "hard core enabled" } }'`
if [ "${FIND1}" = "soft core enabled" -o "${FIND2}" = "hard core enabled" ]; then
logtext "Result: core dumps (soft or hard) are enabled"
Display --indent 2 --text "- Checking core dumps configuration" --result ENABLED --color YELLOW