All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: Tom Rini <trini@konsulko.com>
Cc: "Simon Glass" <sjg@chromium.org>,
	"U-Boot Mailing List" <u-boot@lists.denx.de>,
	u-boot-board-maintainers@lists.denx.de,
	"Rasmus Villemoes" <rasmus.villemoes@prevas.dk>,
	u-boot-custodians@lists.denx.de,
	"Heinrich Schuchardt" <xypron.glpk@gmx.de>,
	"Marek Behún" <marek.behun@nic.cz>,
	"Joe Hershberger" <joe.hershberger@ni.com>
Subject: Re: [PATCH v10 3/9] env: Allow U-Boot scripts to be placed in a .env file
Date: Sun, 24 Oct 2021 17:41:46 +0200	[thread overview]
Message-ID: <3903304.1635090106@gemini.denx.de> (raw)
In-Reply-To: <20211022142912.GF3577824@bill-the-cat>

Dear Tom,

In message <20211022142912.GF3577824@bill-the-cat> you wrote:
> 
> > However, '\' is also a legal character in a variable name (and
> > doubled backslashes or apostrophes etc. are legal, too), so
> > above line should actually set the environment variable "maximum\+"
> > to "value".
>
> I feel I should preface this with "I am cranky".  Now I see that I can
> indeed do:
> => setenv foo\\bar baz
> => printenv foo\\bar
> foo\bar=baz
>
> on a system today.  To what value, I know not.

That's simple: historical reasons.

I already explained that: when I wrote the environment code, memory
was a very precious resource, so I implemented absolutely no
checking that could be avoided.  '=' was nevessary to separate name
from value, and NUL was necessary to terminate an entry. All other
characters where legal.

Yes, this can be misused to have all kinds of fun, like embedded
terminal control sequences or "invisible" variable names:

	=> setenv 'foo^H^H^H' bar
	=> printenv
	=bar
	arch=sandbox
	baudrate=115200
	...

You don't like it? Don't do it, then.

Yes, robust programming is something different, but at that time we
were fighting for 10 or 20 byte code size - there were so many
systems where U-Boot, Linux, and root file system had to fit into
4 MB flash or so.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Any sufficiently advanced bug is indistinguishable from a feature.
                                                      - Rich Kulawiec

  parent reply	other threads:[~2021-10-24 15:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22  3:08 [PATCH v10 0/9] env: Allow environment in text files Simon Glass
2021-10-22  3:08 ` [PATCH v10 1/9] sandbox: Drop distro_boot Simon Glass
2021-11-17  1:57   ` Tom Rini
2021-10-22  3:08 ` [PATCH v10 2/9] doc: Move environment documentation to rST Simon Glass
2021-10-22  3:08 ` [PATCH v10 3/9] env: Allow U-Boot scripts to be placed in a .env file Simon Glass
2021-10-22  8:29   ` Wolfgang Denk
2021-10-22 14:29     ` Tom Rini
2021-10-22 23:29       ` Tony Dinh
2021-10-24 15:41       ` Wolfgang Denk [this message]
2021-11-12 18:12   ` Daniel Golle
2021-11-13 14:19     ` Simon Glass
2022-02-10 11:20   ` Patrick DELAUNAY
2022-03-12 18:14     ` Simon Glass
2021-10-22  3:08 ` [PATCH v10 4/9] sandbox: Use a text-based environment Simon Glass
2021-10-22  3:08 ` [PATCH v10 5/9] doc: Mention CONFIG_DEFAULT_ENV_FILE Simon Glass
2021-10-22  3:08 ` [PATCH v10 6/9] doc: Improve environment documentation Simon Glass
2021-10-22  3:08 ` [PATCH v10 7/9] doc: Improve environment documentation further Simon Glass
2021-10-23  8:23   ` Heinrich Schuchardt
2022-03-12  2:24     ` Simon Glass
2021-10-22  3:08 ` [PATCH v10 8/9] sandbox: Update the test MAC/IP addresses Simon Glass
2021-10-23  8:29   ` Heinrich Schuchardt
2021-10-24 19:54     ` Simon Glass
2021-10-24 21:39       ` Tom Rini
2021-10-22  3:08 ` [PATCH v10 9/9] bootm: Tidy up use of autostart env var Simon Glass

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=3903304.1635090106@gemini.denx.de \
    --to=wd@denx.de \
    --cc=joe.hershberger@ni.com \
    --cc=marek.behun@nic.cz \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot-board-maintainers@lists.denx.de \
    --cc=u-boot-custodians@lists.denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.