Blame 0037-fix-_getcmdline-arg-duplicating-bug-with-etc-cmdline.patch

Harald Hoyer 0c26bf
From 982161e062e1696067cc19a990a31924b29c0df1 Mon Sep 17 00:00:00 2001
Harald Hoyer 0c26bf
From: Will Woods <wwoods@redhat.com>
Harald Hoyer 0c26bf
Date: Tue, 1 May 2012 14:08:33 -0400
Harald Hoyer 0c26bf
Subject: [PATCH] fix _getcmdline arg-duplicating bug with /etc/cmdline*
Harald Hoyer 0c26bf
Harald Hoyer 0c26bf
If you unset CMDLINE to make _getcmdline re-read /etc/cmdline and
Harald Hoyer 0c26bf
/etc/cmdline.d/*, CMDLINE_ETC and CMDLINE_ETC_D would keep their
Harald Hoyer 0c26bf
contents.
Harald Hoyer 0c26bf
Harald Hoyer 0c26bf
This is a serious problem if you have (e.g.) "ip=eth0:dhcp" in
Harald Hoyer 0c26bf
/etc/cmdline.d/net.conf, because getargs ip= will return
Harald Hoyer 0c26bf
"ip=eth0:dhcp ip=eth0:dhcp" and then parse-ip-opts.sh will die() because
Harald Hoyer 0c26bf
you have two configurations for eth0.
Harald Hoyer 0c26bf
---
Harald Hoyer 0c26bf
 modules.d/99base/dracut-lib.sh |    1 +
Harald Hoyer 0c26bf
 1 Datei geändert, 1 Zeile hinzugefügt(+)
Harald Hoyer 0c26bf
Harald Hoyer 0c26bf
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
Harald Hoyer 0c26bf
index a6b8d1a..ddb6954 100755
Harald Hoyer 0c26bf
--- a/modules.d/99base/dracut-lib.sh
Harald Hoyer 0c26bf
+++ b/modules.d/99base/dracut-lib.sh
Harald Hoyer 0c26bf
@@ -48,6 +48,7 @@ _getcmdline() {
Harald Hoyer 0c26bf
     local _i
Harald Hoyer 0c26bf
     unset _line
Harald Hoyer 0c26bf
     if [ -z "$CMDLINE" ]; then
Harald Hoyer 0c26bf
+        unset CMDLINE_ETC CMDLINE_ETC_D
Harald Hoyer 0c26bf
         if [ -e /etc/cmdline ]; then
Harald Hoyer 0c26bf
             while read -r _line; do
Harald Hoyer 0c26bf
                 CMDLINE_ETC="$CMDLINE_ETC $_line";