From 905ef88c49a611f0a0a91d5cf8d33e92f15638b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lecour?= Date: Wed, 6 Nov 2019 07:43:43 +0100 Subject: [PATCH] fix grep in IS_TMPNOEXEC --- evocheck.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evocheck.sh b/evocheck.sh index 5bd695b..fe7d908 100755 --- a/evocheck.sh +++ b/evocheck.sh @@ -255,9 +255,9 @@ check_tmpnoexec() { FINDMNT_BIN=$(command -v findmnt) if [ -x ${FINDMNT_BIN} ]; then options=$(${FINDMNT_BIN} --noheadings --first-only --output OPTIONS /tmp) - grep -qE "\bnoexec\b" ${options} || failed "IS_TMPNOEXEC" "/tmp is not mounted with 'noexec'" + echo "${options}" | grep -qE "\bnoexec\b" || failed "IS_TMPNOEXEC" "/tmp is not mounted with 'noexec'" else - mount | grep "on /tmp" | grep -q noexec || failed "IS_TMPNOEXEC" "/tmp is not mounted with 'noexec' (WARNING: findmnt(8) is not found)" + mount | grep "on /tmp" | grep -qE "\bnoexec\b" || failed "IS_TMPNOEXEC" "/tmp is not mounted with 'noexec' (WARNING: findmnt(8) is not found)" fi } check_mountfstab() {