]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(dracut-functions): word splitting issue for sed in get_ucode_file
authorKairui Song <kasong@redhat.com>
Fri, 9 Apr 2021 16:57:32 +0000 (00:57 +0800)
committerHarald Hoyer <harald@hoyer.xyz>
Mon, 12 Apr 2021 07:17:18 +0000 (09:17 +0200)
This unquated regex could be splitted into two arguments and sed will
not work. I've see giving error of wrong arguments being used on my
desktop.

Signed-off-by: Kairui Song <kasong@redhat.com>
dracut-functions.sh

index 14cc90d05ce729860a443300b1ef6329d93cdd72..5af4e458622a44a91dc3e272ca8b3789d465e1b1 100755 (executable)
@@ -709,9 +709,9 @@ get_ucode_file() {
     local family
     local model
     local stepping
-    family=$(grep -E "cpu family" /proc/cpuinfo | head -1 | sed s/.*:\ //)
-    model=$(grep -E "model" /proc/cpuinfo | grep -v name | head -1 | sed s/.*:\ //)
-    stepping=$(grep -E "stepping" /proc/cpuinfo | head -1 | sed s/.*:\ //)
+    family=$(grep -E "cpu family" /proc/cpuinfo | head -1 | sed "s/.*:\ //")
+    model=$(grep -E "model" /proc/cpuinfo | grep -v name | head -1 | sed "s/.*:\ //")
+    stepping=$(grep -E "stepping" /proc/cpuinfo | head -1 | sed "s/.*:\ //")
 
     if [[ "$(get_cpu_vendor)" == "AMD" ]]; then
         if [[ $family -ge 21 ]]; then