2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-22 18:17:09 +00:00

Test suite: don't use fragile shell construct mixing string and array

The previous code happened to work only because we always pass either 0 or 1
arguments to these functions. If we ever passed them 2+ arguments,
unexpected things would happen.

For details, see https://www.shellcheck.net/wiki/SC2145
This commit is contained in:
intrigeri 2022-02-13 07:30:42 +00:00
parent fb94661937
commit 14d35c651c
4 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@ ${__dbus_var_decl}
$test { $test {
@{gen $test} @{gen $test}
unix, unix,
$@ $*
signal receive peer=unconfined, signal receive peer=unconfined,
} }
EOF EOF

View File

@ -33,7 +33,7 @@ confined_args="--log=$confined_log $listnames"
message_gendbusprofile() message_gendbusprofile()
{ {
gendbusprofile "${confined_log} w, gendbusprofile "${confined_log} w,
$@" $*"
} }
start_bus start_bus

View File

@ -62,7 +62,7 @@ service_runchecktest()
service_gendbusprofile() service_gendbusprofile()
{ {
gendbusprofile "$unconfined_log w, gendbusprofile "$unconfined_log w,
$@" $*"
} }
start_bus start_bus

View File

@ -63,7 +63,7 @@ ur_gendbusprofile()
{ {
gendbusprofile "$confined_log w, gendbusprofile "$confined_log w,
dbus bind bus=$bus name=$dest, dbus bind bus=$bus name=$dest,
$@" $*"
} }
start_bus start_bus