]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: (lsfd) put double quote characters around variable expansions
authorMasatake YAMATO <yamato@redhat.com>
Fri, 9 Sep 2022 15:38:37 +0000 (00:38 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Mon, 12 Sep 2022 12:48:21 +0000 (21:48 +0900)
This fixes the potential problems reported by github-code-scan.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
tests/ts/lsfd/column-ainodeclass
tests/ts/lsfd/column-name
tests/ts/lsfd/column-type

index b80f7b8ac00b51f976aab55f7d621b4674d716d8..3db9189de69d625ec85ec5ee45995a87f39feae7 100755 (executable)
@@ -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
index c2b80cb8e9d6f8b68756642891624269f4924528..6db1fc7a690a354293fd9485c011a4e28f9c10db 100755 (executable)
@@ -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
index 5ecb2516c80b4670a772a6176805fd3cc9653e97..91e7348da58881817c1728a6a89c6923e50c20b3 100755 (executable)
@@ -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