aboutsummaryrefslogtreecommitdiff
path: root/shell/msh.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* applyinf fix for:pgf2005-07-201-1/+1
| | | | | | | | 0000155: variable expansion with braces in backticks in msh git-svn-id: svn://busybox.net/trunk/busybox@10876 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Jonas Holmberg from axis dot com writes:andersen2004-09-021-22/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: svn://busybox.net/trunk/busybox@9199 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Quiet a few warningsandersen2004-08-271-19/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@9179 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Michael Leibow, MichaelLe at belkin.com writes:andersen2004-08-041-375/+1056
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A question was posted a month ago by Mark Alamo to see if others had problems with sourcing subscripts within msh. We asked his firm to fix the msh.c bug he described because we didn't have enough time to do it ourselves. When msh.c is executing a compound statement and there is a . command to source another script file, msh.c will not execute the subscript until it's completed executing the rest of the compound statement. His example was this: Echo "Start" ; . ./subA; echo "mid" ; . ./subB ; echo "end" subA and subB execute AFTER end is printed in reverse order. The same is true if the sourced files are inside an if else fi, case esac, or any compound statement. Attached is a patch to msh.c. It fixes the problem. Cd to the root of your busybox tree and execute "patch -p1 < msh.c.patch" Unfortunately, I won't have more time to work on this so I hope that there aren't any problems! Michael Leibow Senior Software Engineer Belkin Corporation git-svn-id: svn://busybox.net/trunk/busybox@9062 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Run msh through indentandersen2004-08-041-1313/+1164
| | | | git-svn-id: svn://busybox.net/trunk/busybox@9061 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Larry Doolittle writes:andersen2004-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This is a bulk spelling fix patch against busybox-1.00-pre10. If anyone gets a corrupted copy (and cares), let me know and I will make alternate arrangements. Erik - please apply. Authors - please check that I didn't corrupt any meaning. Package importers - see if any of these changes should be passed to the upstream authors. I glossed over lots of sloppy capitalizations, missing apostrophes, mixed American/British spellings, and German-style compound words. What is "pretect redefined for test" in cmdedit.c? Good luck on the 1.00 release! - Larry git-svn-id: svn://busybox.net/trunk/busybox@8759 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Remove the CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN option. It was sortofandersen2004-04-071-3/+0
| | | | | | | stupid and didn't work properly anyways. git-svn-id: svn://busybox.net/trunk/busybox@8714 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Remove trailing whitespace. Update copyright to include 2004.andersen2004-03-151-27/+27
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8630 69ca8d6d-28ef-0310-b511-8ec308f3f277
* move all "-/bin/sh" "/bin/sh" and "sh" to libbb/messages.c file as onebug12003-09-021-4/+3
| | | | | | | | constant. Vodz last_patch_107 git-svn-id: svn://busybox.net/trunk/busybox@7365 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Update a bunch of docs. Run a script to update my email addr.andersen2003-07-141-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@7061 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Major coreutils update.mjn32003-03-191-3/+3
| | | | git-svn-id: svn://busybox.net/trunk/busybox@6751 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Jonas Holmberg, adjusted by Robert Schwebel, andandersen2003-03-141-55/+144
| | | | | | | later re-adjusted by me to fix msh backtick handling git-svn-id: svn://busybox.net/trunk/busybox@6748 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fixup all the horrible broken function prototypesandersen2002-12-111-37/+29
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@6165 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Ensure that getenv("PATH") stays current, since otherwise cmdeditandersen2002-04-261-0/+2
| | | | | | | | | (which calls getenv("PATH")) would not operate upon the current PATH settings, which was really quite iritating. -Erik git-svn-id: svn://busybox.net/trunk/busybox@4677 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Major rework of the directory structure and the entire build system.andersen2001-10-241-13/+13
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@3561 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Add an option to make the shells not advertise their busybox natureandersen2001-10-191-0/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@3548 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Add support for underscores in variable names.kraai2001-08-061-13/+13
| | | | git-svn-id: svn://busybox.net/trunk/busybox@3212 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Allow multiple shells to be enabled.kraai2001-08-011-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@3177 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from vodz:andersen2001-07-121-9/+3
| | | | | | | | | | Changed email address cmdedit API change optimizations for traceroute and md5sum added a new shared create_icmp_socket() function git-svn-id: svn://busybox.net/trunk/busybox@3078 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Allow assignments in the export and readonly commands.kraai2001-07-121-1/+9
| | | | git-svn-id: svn://busybox.net/trunk/busybox@3077 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Remove debugging statement.kraai2001-07-121-1/+0
| | | | git-svn-id: svn://busybox.net/trunk/busybox@3075 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Add in a shell tagline (per lash/hush behavior) to make it easierandersen2001-07-071-30/+98
| | | | | | | | | to know which shell is in use. Add in 'help' to list available builtins, and fixup msh so it can do STANDALONE_SHELL. -Erik git-svn-id: svn://busybox.net/trunk/busybox@3025 69ca8d6d-28ef-0310-b511-8ec308f3f277
* This is a busybox port of the Minix shell. It is reasonably capable,andersen2001-06-291-0/+4799
handles all the basic stuff (for, case/esac, while, if/then/else), and is very small (adds just 38k on x86). It is not as rigorously correct about Bourne semantics as bash, but for most things it is quite workable. There is still some work to be done to further shrink it (it has its own globbing functions instead of using the libc ones, for example), but it is quite usable as is. -Erik git-svn-id: svn://busybox.net/trunk/busybox@2949 69ca8d6d-28ef-0310-b511-8ec308f3f277