From 6e366172f88971583f875d2aa2d4e04a77250e51 Mon Sep 17 00:00:00 2001 From: "thibault.dewailly" Date: Fri, 22 Apr 2016 16:59:52 +0200 Subject: [PATCH] Fixed 6.15 netstat analysis --- bin/hardening/6.15_mta_localhost.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/hardening/6.15_mta_localhost.sh b/bin/hardening/6.15_mta_localhost.sh index 033c6e1..13202f5 100755 --- a/bin/hardening/6.15_mta_localhost.sh +++ b/bin/hardening/6.15_mta_localhost.sh @@ -14,8 +14,9 @@ set -u # One variable unset, it's over # This function will be called if the script status is on enabled / audit mode audit () { info "Checking netport ports opened" - eval 'RESULT=$(netstat -an | grep LIST | grep ":25[[:space:]]")' - debug "Result is $RESULT" + RESULT=$(netstat -an | grep LIST | grep ":25[[:space:]]") || : + RESULT=${RESULT:-} + debug "Result is $RESULT" if [ -z "$RESULT" ]; then ok "Nothing listens on 25 port, probably unix socket configured" else @@ -31,7 +32,8 @@ audit () { # This function will be called if the script status is on enabled mode apply () { info "Checking netport ports opened" - eval 'RESULT=$(netstat -an | grep LIST | grep ":25[[:space:]]")' + RESULT=$(netstat -an | grep LIST | grep ":25[[:space:]]") || : + RESULT=${RESULT:-} debug "Result is $RESULT" if [ -z "$RESULT" ]; then ok "Nothing listens on 25 port, probably unix socket configured"