]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-lib.sh: fix dropped backslashes in CMDLINE
authorWill Woods <wwoods@redhat.com>
Thu, 13 Oct 2011 02:48:08 +0000 (22:48 -0400)
committerHarald Hoyer <harald@redhat.com>
Tue, 18 Oct 2011 15:13:48 +0000 (17:13 +0200)
The "read" shell builtin consumes backslashes, which is a problem if
your root device is something like "LABEL=Fedora\x2016".

Using "read -r" tells the shell to leave backslashes alone.

modules.d/99base/dracut-lib.sh

index 62c3bf54a058898965a3c7a87d059b157ae2aed3..bc4d7c938f9dc31ddd41488781cfee33822a7d48 100755 (executable)
@@ -35,11 +35,11 @@ _getcmdline() {
     unset _line
     if [ -z "$CMDLINE" ]; then
         if [ -e /etc/cmdline ]; then
-            while read _line; do
+            while read -r _line; do
                 CMDLINE_ETC="$CMDLINE_ETC $_line";
             done </etc/cmdline;
         fi
-        read CMDLINE </proc/cmdline;
+        read -r CMDLINE </proc/cmdline;
         CMDLINE="$CMDLINE $CMDLINE_ETC"
     fi
 }