[U-Boot] [PATCH 2/3] hush: Don't parse the contents of a dereferenced var

Wolfgang Denk wd at denx.de
Sun Sep 2 20:31:28 CEST 2012


Dear Joe Hershberger,

In message <1345235191-13757-2-git-send-email-joe.hershberger at 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 <joe.hershberger at ni.com>
> ---
>  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.


More information about the U-Boot mailing list