Mail archive
alpine-devel

[alpine-devel] [PATCH 2/3] init: fix quoting issue for kernel arguments

From: Shiz <hi_at_shiz.me>
Date: Thu, 17 Nov 2016 02:52:51 +0100

The kernel passes arguments from /proc/cmdline as a single string like
foo=bar baz="something with spaces". In the latter case, with the added
single quotes the actual value of ${KOPT_baz} would contain these quotes
as well, which is not the intention.
---
 initramfs-init.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/initramfs-init.in b/initramfs-init.in
index 78bcbe4..9aa1d3f 100755
--- a/initramfs-init.in
+++ b/initramfs-init.in
_at_@ -279,7 +279,7 @@ for opt; do
 
 	for i in $myopts; do
 		case "$opt" in
-		$i=*)	eval "KOPT_${i}='${opt#*=}'";;
+		$i=*)	eval "KOPT_${i}=${opt#*=}";;
 		$i)	eval "KOPT_${i}=yes";;
 		no$i)	eval "KOPT_${i}=no";;
 		esac
-- 
2.10.0
---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Thu Nov 17 2016 - 02:52:51 UTC