eudev: fix printf usage in init script
authorCarlos Santos <casantos@datacom.ind.br>
Tue, 30 Jan 2018 04:07:19 +0000 (02:07 -0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 30 Jan 2018 21:58:17 +0000 (22:58 +0100)
Using a variable in a printf format string may lead to undesirable
results if the variable contains format controls, so replace

    printf "foo $var bar"

by

    printf "foo %s bar" "$var"

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/eudev/S10udev

index 654a04df36877af03c986f111602c5b694f0827f..640fec625bbed1456f7f2e37573466b6b9c33e7f 100755 (executable)
@@ -27,7 +27,7 @@ test -r $UDEV_CONFIG || exit 6
 
 case "$1" in
     start)
-        printf "Populating ${udev_root:-/dev} using udev: "
+        printf "Populating %s using udev: " "${udev_root:-/dev}"
         printf '\000\000\000\000' > /proc/sys/kernel/hotplug
         $UDEV_BIN -d || { echo "FAIL"; exit 1; }
         udevadm trigger --type=subsystems --action=add