]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: (lsfd) fix the potential problems reported by github-code-scan
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:24 +0000 (21:48 +0900)
Use arrays.

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

index 6db1fc7a690a354293fd9485c011a4e28f9c10db..f87296c9afe23fe9048fb128880eef02f722ad45 100755 (executable)
@@ -33,11 +33,13 @@ EXPR="(FD == 3)"
 {
     for C in ro-regular-file pidfd socketpair; do
        coproc MKFDS {
+           argv=()
            case $C in
                socketpair)
-                   argv="$((FD + 1)) socktype=DGRAM"
+                   argv[0]="$((FD + 1))"
+                   argv[1]="socktype=DGRAM"
            esac
-           "$TS_HELPER_MKFDS" $C $FD ${argv}
+           "$TS_HELPER_MKFDS" $C $FD "${argv[@]}"
        }
        if read -r -u "${MKFDS[0]}" PID; then
            ${TS_CMD_LSFD} -n -o ASSOC,KNAME,NAME -p "${PID}" -Q "${EXPR}" | {
index 91e7348da58881817c1728a6a89c6923e50c20b3..d31b71254deccbba177ac5726dfd51b2e790ef18 100755 (executable)
@@ -32,11 +32,13 @@ EXPR="(FD == 3)"
 {
     for C in ro-regular-file pidfd inotify socketpair; do
        coproc MKFDS {
+           argv=()
            case $C in
                socketpair)
-                   argv="$((FD + 1)) socktype=DGRAM"
+                   argv[0]="$((FD + 1))"
+                   argv[1]="socktype=DGRAM"
            esac
-           "$TS_HELPER_MKFDS" $C $FD ${argv}
+           "$TS_HELPER_MKFDS" $C $FD "${argv[@]}"
        }
        if read -r -u "${MKFDS[0]}" PID; then
            ${TS_CMD_LSFD} -n -o ASSOC,STTYPE,TYPE -p "${PID}" -Q "${EXPR}"