FIX: quotes in find command, misinterpreted shellcheck advice

This commit is contained in:
Charles Herlin 2019-01-23 16:55:48 +01:00
parent ec6b79e3c7
commit bfbd410b19
2 changed files with 4 additions and 2 deletions

View File

@ -19,7 +19,8 @@ DESCRIPTION="Find SUID system executables."
audit () { audit () {
info "Checking if there are suid files" info "Checking if there are suid files"
FS_NAMES=$(df --local -P | awk '{ if (NR!=1) print $6 }' ) FS_NAMES=$(df --local -P | awk '{ if (NR!=1) print $6 }' )
FOUND_BINARIES=$( $SUDO_CMD find "$FS_NAMES" -xdev -type f -perm -4000 -print) # shellcheck disable=2086
FOUND_BINARIES=$( $SUDO_CMD find $FS_NAMES -xdev -type f -perm -4000 -print)
BAD_BINARIES="" BAD_BINARIES=""
for BINARY in $FOUND_BINARIES; do for BINARY in $FOUND_BINARIES; do
if grep -qw "$BINARY" <<< "$EXCEPTIONS"; then if grep -qw "$BINARY" <<< "$EXCEPTIONS"; then

View File

@ -19,7 +19,8 @@ DESCRIPTION="Find SGID system executables."
audit () { audit () {
info "Checking if there are sgid files" info "Checking if there are sgid files"
FS_NAMES=$(df --local -P | awk '{ if (NR!=1) print $6 }' ) FS_NAMES=$(df --local -P | awk '{ if (NR!=1) print $6 }' )
FOUND_BINARIES=$( $SUDO_CMD find "$FS_NAMES" -xdev -type f -perm -2000 -print) # shellcheck disable=2086
FOUND_BINARIES=$( $SUDO_CMD find $FS_NAMES -xdev -type f -perm -2000 -print)
BAD_BINARIES="" BAD_BINARIES=""
for BINARY in $FOUND_BINARIES; do for BINARY in $FOUND_BINARIES; do
if grep -qw "$BINARY" <<< "$EXCEPTIONS"; then if grep -qw "$BINARY" <<< "$EXCEPTIONS"; then