busybox/shell
Eric Andersen fd7a4c8c28 Jonas Holmberg from axis dot com writes:
This patch makes msh handle variable expansion within backticks more
correctly.

Current behaviour (wrong):
--------------------------

BusyBox v1.00-rc3 (2004.08.26-11:51+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

$ A='`echo hello`'
$ echo $A
`echo hello`
$ echo `echo $A`
hello
$


New behaviour (correct):
------------------------

BusyBox v1.00-rc3 (2004.08.26-11:51+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

$ A='`echo hello`'
$ echo $A
`echo hello`
$ echo `echo $A`
`echo hello`
$

The current behaviour (wrong according to standards) was actually my
fault. msh handles backticks by executing a subshell (which makes it
work on MMU-less systems). Executing a subshell makes it hard to only
expand variables once in the parent. Therefore I export all variables
that will be expanded within the backticks and let the subshell handle
the expansion instead.

The bug was found while searching for security leaks in CGI-scripts.
Current behaviour of msh makes it easy to expand backticks by mistake
in $QUERY_STRING. I recommend appling the patch before release of bb
1.00.

/Jonas
2004-09-02 23:13:10 +00:00
..
ash.c Patch from Vladimir N. Oleynik: 2004-08-19 18:22:13 +00:00
cmdedit.c Patch from Vladimir N. Oleynik: 2004-08-19 18:22:13 +00:00
cmdedit.h Vodz last_patch_122, Check $PATH at runtime to fix tab completion 2004-01-14 09:34:51 +00:00
Config.in Patch from Bastian Blank: 2004-06-22 08:29:45 +00:00
hush.c Larry Doolittle writes: 2004-04-14 17:51:38 +00:00
lash.c Joe.C writes: 2004-08-16 08:38:34 +00:00
Makefile Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
Makefile.in Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
msh.c Jonas Holmberg from axis dot com writes: 2004-09-02 23:13:10 +00:00