]> git.ipfire.org Git - people/ms/u-boot.git/commit
hush: Don't parse the contents of a dereferenced var
authorJoe Hershberger <joe.hershberger@ni.com>
Fri, 17 Aug 2012 10:26:30 +0000 (10:26 +0000)
committerWolfgang Denk <wd@denx.de>
Sun, 2 Sep 2012 18:31:21 +0000 (20:31 +0200)
commita005f19eff946454985785788c344f10616d571e
tree0399c46a5551a7a83c37f75574891126019ef378
parent641b0d374eeea65778bf8cb2107064c2aff195eb
hush: Don't parse the contents of a dereferenced var

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@ni.com>
common/hush.c