Re: [PATCH] boot parameters: quoting of environment variables revisited

From: Werner Almesberger
Date: Tue Oct 19 2004 - 21:40:52 EST


Andrew Morton wrote:
> hm. The environment string handling and the "command line" string handling
> appear to be identical in there. How come only one of them has the
> problem? That function makes my eyes bleed.

The joy of "clever" string manipulation, I suppose :-(

The difference between the two branches is that the "command line"
thing uses only the parameter name, which cannot be quoted (well,
at least kernel/params.c doesn't let this happen). So the whole
problem can't occur.

If you quote the parameter name, the quotes will happily end up
in the argument, thanks to kernel/params.c.

Perhaps a better long-term solution would be to fix all this in
kernel/params.c, and remove any quote special-casing from
init/main.c. It just scares me to touch such a highly sensitive
area of the kernel ... :)

- Werner

--
_________________________________________________________________________
/ Werner Almesberger, Buenos Aires, Argentina werner@xxxxxxxxxxxxxxx /
/_http://www.almesberger.net/____________________________________________/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/