From: Masatake YAMATO Date: Fri, 9 Sep 2022 15:38:37 +0000 (+0900) Subject: tests: (lsfd) put double quote characters around variable expansions X-Git-Tag: v2.39-rc1~527^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e51ea8679147af3d1db5bad6cbef4217889b393;p=thirdparty%2Futil-linux.git tests: (lsfd) put double quote characters around variable expansions This fixes the potential problems reported by github-code-scan. Signed-off-by: Masatake YAMATO --- diff --git a/tests/ts/lsfd/column-ainodeclass b/tests/ts/lsfd/column-ainodeclass index b80f7b8ac0..3db9189de6 100755 --- a/tests/ts/lsfd/column-ainodeclass +++ b/tests/ts/lsfd/column-ainodeclass @@ -17,7 +17,7 @@ TS_TOPDIR="${0%/*}/../.." TS_DESC="ainodeclass column" -. $TS_TOPDIR/functions.sh +. "$TS_TOPDIR"/functions.sh ts_init "$*" ts_check_test_command "$TS_CMD_LSFD" @@ -32,14 +32,14 @@ EXPR="(FD == 3)" { for C in pidfd inotify; do coproc MKFDS { "$TS_HELPER_MKFDS" $C $FD ; } - if read -u ${MKFDS[0]} PID; then + if read -r -u "${MKFDS[0]}" PID; then ${TS_CMD_LSFD} -n -o ASSOC,STTYPE,AINODECLASS -p "${PID}" -Q "${EXPR}" echo "$C"':ASSOC,STTYPE,AINODECLASS': $? - kill -CONT ${PID} - wait ${MKFDS_PID} + kill -CONT "${PID}" + wait "${MKFDS_PID}" fi done -} > $TS_OUTPUT 2>&1 +} > "$TS_OUTPUT" 2>&1 ts_finalize diff --git a/tests/ts/lsfd/column-name b/tests/ts/lsfd/column-name index c2b80cb8e9..6db1fc7a69 100755 --- a/tests/ts/lsfd/column-name +++ b/tests/ts/lsfd/column-name @@ -17,7 +17,7 @@ TS_TOPDIR="${0%/*}/../.." TS_DESC="NAME and KNAME column" -. $TS_TOPDIR/functions.sh +. "$TS_TOPDIR"/functions.sh ts_init "$*" ts_check_test_command "$TS_CMD_LSFD" @@ -39,7 +39,7 @@ EXPR="(FD == 3)" esac "$TS_HELPER_MKFDS" $C $FD ${argv} } - if read -u ${MKFDS[0]} PID; then + if read -r -u "${MKFDS[0]}" PID; then ${TS_CMD_LSFD} -n -o ASSOC,KNAME,NAME -p "${PID}" -Q "${EXPR}" | { # Replace the unpredictable an inode number for the socket # with "INODENUM". @@ -47,10 +47,10 @@ EXPR="(FD == 3)" } echo "$C"':ASSOC,KNAME,NAME': $? - kill -CONT ${PID} - wait ${MKFDS_PID} + kill -CONT "${PID}" + wait "${MKFDS_PID}" fi done -} > $TS_OUTPUT 2>&1 +} > "$TS_OUTPUT" 2>&1 ts_finalize diff --git a/tests/ts/lsfd/column-type b/tests/ts/lsfd/column-type index 5ecb2516c8..91e7348da5 100755 --- a/tests/ts/lsfd/column-type +++ b/tests/ts/lsfd/column-type @@ -17,7 +17,7 @@ TS_TOPDIR="${0%/*}/../.." TS_DESC="TYPE and STTYPE column" -. $TS_TOPDIR/functions.sh +. "$TS_TOPDIR"/functions.sh ts_init "$*" ts_check_test_command "$TS_CMD_LSFD" @@ -38,14 +38,14 @@ EXPR="(FD == 3)" esac "$TS_HELPER_MKFDS" $C $FD ${argv} } - if read -u ${MKFDS[0]} PID; then + if read -r -u "${MKFDS[0]}" PID; then ${TS_CMD_LSFD} -n -o ASSOC,STTYPE,TYPE -p "${PID}" -Q "${EXPR}" echo "$C"':ASSOC,STTYPE,TYPE': $? - kill -CONT ${PID} - wait ${MKFDS_PID} + kill -CONT "${PID}" + wait "${MKFDS_PID}" fi done -} > $TS_OUTPUT 2>&1 +} > "$TS_OUTPUT" 2>&1 ts_finalize