From d60922ab9ddc7b33b036783c974e6adfb4c95143 Mon Sep 17 00:00:00 2001 From: Charles Herlin Date: Mon, 19 Mar 2018 18:06:47 +0100 Subject: [PATCH] Redirect stderr to avoid printing "no such file" error --- bin/hardening/4.1_restrict_core_dumps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/hardening/4.1_restrict_core_dumps.sh b/bin/hardening/4.1_restrict_core_dumps.sh index f8fa343..345c6ac 100755 --- a/bin/hardening/4.1_restrict_core_dumps.sh +++ b/bin/hardening/4.1_restrict_core_dumps.sh @@ -24,7 +24,7 @@ audit () { SEARCH_RES=0 LIMIT_FILES="" if $SUDO_CMD [ -d $LIMIT_DIR ]; then - for file in $($SUDO_CMD ls $LIMIT_DIR/*.conf); do + for file in $($SUDO_CMD ls $LIMIT_DIR/*.conf 2>/dev/null); do LIMIT_FILES="$LIMIT_FILES $LIMIT_DIR/$file" done fi