]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Ensure that udevadm --version reported an integer
authorMikhail Novosyolov <m.novosyolov@rosalinux.ru>
Sat, 2 Nov 2019 18:32:38 +0000 (21:32 +0300)
committerDaniel Molkentin <daniel@molkentin.de>
Tue, 5 Nov 2019 13:26:14 +0000 (14:26 +0100)
If it is not an integer, further script will fail unexepectedly.

dracut-init.sh

index 64a2294aae311df6660df10385c932c3d1eb3dc1..0ff9b7e53aeb40836e8ffe93be18ab75a84ec253 100644 (file)
@@ -465,6 +465,10 @@ prepare_udev_rules() {
         derror "Failed to detect udev version!"
         return 1
     fi
+    if [ -z "${UDEVVERSION##*[!0-9]*}" ]; then
+        derror "udevadm --version did not report an integer, udev version cannot be determined!"
+        return 1
+    fi
 
     for f in "$@"; do
         f="${initdir}/etc/udev/rules.d/$f"