From: Wolfgang Denk Date: Sun, 02 Sep 2012 20:31:28 +0200 Subject: [U-Boot] [PATCH 2/3] hush: Don't parse the contents of a dereferenced var In-Reply-To: <1345235191-13757-2-git-send-email-joe.hershberger@ni.com> References: <1345235191-13757-1-git-send-email-joe.hershberger@ni.com> <1345235191-13757-2-git-send-email-joe.hershberger@ni.com> Message-ID: <20120902183128.CD8A8203B2F@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Joe Hershberger, In message <1345235191-13757-2-git-send-email-joe.hershberger@ni.com> you wrote: > When a variable which contains a user-supplied value is dereferenced > (e.g. to be echo'ed), make sure that the value is not further parsed > by hush. > > Set the hush local variable "HUSH_NO_EVAL=1" to enable this behavior. > > Without this patch, a sequence like this occurs: > > Panda # env set my_user_string Bob\'s favorite device > Panda # print my_user_string > my_user_string=Bob's favorite device > Panda # echo $my_user_string > syntax error hush.c:3007 > > With this patch, it looks like this: > > Panda # HUSH_NO_EVAL=1 > Panda # env set my_user_string Bob\'s favorite device > Panda # print my_user_string > my_user_string=Bob's favorite device > Panda # echo $my_user_string > Bob's favorite device > > Signed-off-by: Joe Hershberger > --- > common/hush.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- > 1 file changed, 61 insertions(+), 3 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Democracy is mob rule, but with income taxes.