Skip to contentSkip to conversation

eudev: fix printf usage in init script

Buildroot Peter Korsgaard 1 participant 1 message Jan 31, 2018

lore
Share & tools
lore
#0 lore raw

commit: https://git.buildroot.net/buildroot/commit/?id=78d4e60c0e534dd3f1141cc2585fa5ef21ef0720
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2017.02.x

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"

(cherry picked from commit 6298ed8bf46dd546d4ee7244136f2f9bad82ecad)
---
 package/eudev/S10udev | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/eudev/S10udev +1 -1
index 654a04df36..640fec625b 100755
@@ -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