From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05291C433F5 for ; Sun, 24 Oct 2021 15:42:08 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A50B160ED4 for ; Sun, 24 Oct 2021 15:42:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A50B160ED4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3B1F282E7D; Sun, 24 Oct 2021 17:42:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1635090122; bh=1yHsvfvw7Zt0hkOkY5TaeSKFgunM3j+FY1uJxjStkCo=; h=To:cc:From:Subject:In-reply-to:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=hELTwK5GN6e5hfR58rG0AQ8/cUm8YFeGyGX0BK+9vVm++QiBr+Wrs5RjNLdaXlt78 pqh/VYEG/G11nU7sMtvMvz3pVv1y6F+cf+UMV6gRqtbIbVBFpTRwvyW3/JG/WRs+kc KkIgHxnF492/+xknhrMS/kX6pdnVuUOn+8718OEvnbSeRhtgSb2+5HD/+Ni9UuV6GT ajRxyclVjbQl8tEXNJ49QW0+aQnu5QfhTZiNr7Px10W4zDkLaTFluuOJ2M2g5aojDW EUxijh6wFSXHvK7gWmxTLtVAfAer6oQIvXwV7w7hIbv3lYtZhq6BorEvYfsMU+5+y6 B2Rtth7GmopyQ== Received: from janitor.denx.de (unknown [62.91.23.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: noc@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id B89EE834F4; Sun, 24 Oct 2021 17:41:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1635090116; bh=1yHsvfvw7Zt0hkOkY5TaeSKFgunM3j+FY1uJxjStkCo=; h=To:cc:From:Subject:In-reply-to:References:Date:From; b=Ug0PLfax4j8nCKgYOFM6OM7B1J0T+I1kJhtopH2pU17FSW/ChIBiB3FnUeDGwK7dd RZ90MWKuLftYmZUyFyn88Xa6u5+acgGR+dcvCBwJ//uuD/dQnQ93hldFspneLCVQAO YBByJ6MTWgxvoFw60etbeZh4E5NhB9VWo4eJUf/d6arKuPxnHdC+jAm3dqMufDdG7N bwvDbEvBwy3ziVpb8aBNzDqPN1dPCJQehjIeZuU4NepViHFtw633yZJqv8Bz1MfCzJ Puv02MSw5EFn+6l+endMQsVPVD+d7pQpm28F+dijSw+0iIniVU1W4Z3kKo/cjinaaT IEbXECmj6kqQg== Received: by janitor.denx.de (Postfix, from userid 108) id 5FDBFA01DF; Sun, 24 Oct 2021 17:41:56 +0200 (CEST) Received: from gemini.denx.de (gemini.denx.de [10.4.0.2]) by janitor.denx.de (Postfix) with ESMTPS id 07F7EA009C; Sun, 24 Oct 2021 17:41:46 +0200 (CEST) Received: from gemini.denx.de (localhost [IPv6:::1]) by gemini.denx.de (Postfix) with ESMTP id 934A51E0F1B; Sun, 24 Oct 2021 17:41:46 +0200 (CEST) To: Tom Rini cc: Simon Glass , U-Boot Mailing List , u-boot-board-maintainers@lists.denx.de, Rasmus Villemoes , u-boot-custodians@lists.denx.de, Heinrich Schuchardt , Marek =?iso-8859-1?Q?Beh=FAn?= , Joe Hershberger From: Wolfgang Denk Subject: Re: [PATCH v10 3/9] env: Allow U-Boot scripts to be placed in a .env file MIME-Version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8bit In-reply-to: <20211022142912.GF3577824@bill-the-cat> References: <20211022030852.1986718-1-sjg@chromium.org> <20211021210847.v10.3.Ie78bfbfca0d01d9cba501e127f446ec48e1f7afe@changeid> <3765086.1634891366@gemini.denx.de> <20211022142912.GF3577824@bill-the-cat> Comments: In-reply-to Tom Rini message dated "Fri, 22 Oct 2021 10:29:12 -0400." Date: Sun, 24 Oct 2021 17:41:46 +0200 Message-ID: <3903304.1635090106@gemini.denx.de> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean 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