From: Rusty Russell <rusty@rustcorp.com.au>
To: Len Brown <len.brown@intel.com>
Cc: Werner Almesberger <werner@almesberger.net>,
linux-kernel <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] boot parameters: quoting of environmentvariablesrevisited
Date: Fri, 22 Oct 2004 11:01:39 +1000 [thread overview]
Message-ID: <1098406899.12103.66.camel@localhost.localdomain> (raw)
In-Reply-To: <1098258821.26595.4324.camel@d845pe>
On Wed, 2004-10-20 at 17:53, Len Brown wrote:
> On Wed, 2004-10-20 at 03:35, Rusty Russell wrote:
> > On Wed, 2004-10-20 at 17:16, Len Brown wrote:
> > > I verified that this new patch doesn't break the
> > acpi_os_string="Brand X" kernel parameter.
OK, so this is the patch then. We strip " when we hand to __setup or
put into the environment.
Rusty.
Name: Remove quotes around environment variables
Status: Booted on 2.6-bk
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
As noticed by Joey Hess (and thanks for Christoph for forwarding it).
Also requirements from Werner Almesberger.
If someone passes 'foo="some value"' the param engine removes the
quotes and hands 'foo' and 'some value'. The __setup() parameters
expect a single string, and so we try to regenerate it from the two
parts. Finally, we try to place it as an environment variable.
Werner wants quotes stripped out of the environment variable. It
makes sense to do that for __setup, too (so it sees 'foo=some value'),
since __setup functions don't usually handle quotes.
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .23831-linux-2.6.9-bk3/init/main.c .23831-linux-2.6.9-bk3.updated/init/main.c
--- .23831-linux-2.6.9-bk3/init/main.c 2004-10-19 14:34:23.000000000 +1000
+++ .23831-linux-2.6.9-bk3.updated/init/main.c 2004-10-20 14:48:20.000000000 +1000
@@ -287,8 +287,15 @@ static int __init unknown_bootoption(cha
{
/* Change NUL term back to "=", to make "param" the whole string. */
if (val) {
- if (val[-1] == '"') val[-2] = '=';
- else val[-1] = '=';
+ /* param=val or param="val"? */
+ if (val == param+strlen(param)+1)
+ val[-1] = '=';
+ else if (val == param+strlen(param)+2) {
+ val[-2] = '=';
+ memmove(val-1, val, strlen(val)+1);
+ val--;
+ } else
+ BUG();
}
/* Handle obsolete-style parameters */
--
Anyone who quotes me in their signature is an idiot -- Rusty Russell
next prev parent reply other threads:[~2004-10-22 1:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-19 22:23 [PATCH] boot parameters: quoting of environment variables revisited Werner Almesberger
2004-10-20 1:04 ` Andrew Morton
2004-10-20 1:47 ` Werner Almesberger
2004-10-20 6:21 ` Rusty Russell
2004-10-20 7:16 ` [PATCH] boot parameters: quoting of environment variablesrevisited Len Brown
2004-10-20 7:35 ` Rusty Russell
2004-10-20 7:53 ` [PATCH] boot parameters: quoting of environmentvariablesrevisited Len Brown
2004-10-20 8:03 ` Rusty Russell
2004-10-22 1:01 ` Rusty Russell [this message]
2004-10-20 9:04 ` [PATCH] boot parameters: quoting of environment variablesrevisited Werner Almesberger
2004-10-20 9:27 ` [PATCH] boot parameters: quoting of environment variables revisited Werner Almesberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1098406899.12103.66.camel@localhost.localdomain \
--to=rusty@rustcorp.com.au \
--cc=akpm@osdl.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=werner@almesberger.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox