From 32d1155953a04afafdbc31590ff1ae9f840bd37c Mon Sep 17 00:00:00 2001 From: Brian Ginsbach Date: Thu, 19 Mar 2020 17:10:37 -0500 Subject: [PATCH] Fix uses of non-standard find not operator Use ! rather than the non-standard -not find(1) operator. --- include/tests_authentication | 2 +- plugins/plugin_pam_phase1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/tests_authentication b/include/tests_authentication index 02a3bb74..b4520035 100644 --- a/include/tests_authentication +++ b/include/tests_authentication @@ -677,7 +677,7 @@ LogText "Result: directory /etc/pam.d exists" Display --indent 2 --text "- PAM configuration files (pam.d)" --result "${STATUS_FOUND}" --color GREEN LogText "Test: searching PAM configuration files" - FIND=$(${FINDBINARY} ${ROOTDIR}etc/pam.d -not -name "*.pam-old" -type f -print | sort) + FIND=$(${FINDBINARY} ${ROOTDIR}etc/pam.d \! -name "*.pam-old" -type f -print | sort) for FILE in ${FIND}; do LogText "Found file: ${FILE}" done diff --git a/plugins/plugin_pam_phase1 b/plugins/plugin_pam_phase1 index 361918de..46f2e67a 100644 --- a/plugins/plugin_pam_phase1 +++ b/plugins/plugin_pam_phase1 @@ -77,12 +77,12 @@ if [ -d ${PAM_DIRECTORY} ]; then LogText "Result: ${PAM_DIRECTORY} exists" if [ ! "${OS}" = "FreeBSD" -a ! "${OS}" = "NetBSD" ]; then - FIND_FILES=$(find ${PAM_DIRECTORY} -not -name "*.pam-old" -type f -print) + FIND_FILES=$(find ${PAM_DIRECTORY} \! -name "*.pam-old" -type f -print) else if [ -f ${PAM_DIRECTORY}/README ]; then LogText "Skipped checking ${OS} ${PAM_DIRECTORY}/README as a PAM file" fi - FIND_FILES=$(find ${PAM_DIRECTORY} -not -name "README" -not -name "*.pam-old" -type f -print) + FIND_FILES=$(find ${PAM_DIRECTORY} \! -name "README" \! -name "*.pam-old" -type f -print) fi for PAM_FILE in ${FIND_FILES}; do