Suppress shell expansion on echo '*' and echo "*" like cases.

Reported by: Jordan Uggla.

	* grub-core/script/execute.c (grub_script_arglist_to_argv): Escape
	string arguments before shell expansion.
	* tests/grub_cmd_echo.in: New testcases.
This commit is contained in:
BVK Chaitanya 2010-11-07 20:22:29 +05:30
commit 86643a242f
3 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,12 @@
2010-11-07 BVK Chaitanya <bvk.groups@gmail.com>
Suppress shell expansion on echo '*' and echo "*" like cases.
Reported by: Jordan Uggla.
* grub-core/script/execute.c (grub_script_arglist_to_argv): Escape
string arguments before shell expansion.
* tests/grub_cmd_echo.in: New testcases.
2010-11-07 Robert Millan <rmh@gnu.org>
* conf/mips-qemu-mips.rmk: Remove stale file from previous

View File

@ -374,7 +374,7 @@ grub_script_arglist_to_argv (struct grub_script_arglist *arglist,
case GRUB_SCRIPT_ARG_TYPE_DQSTR:
case GRUB_SCRIPT_ARG_TYPE_SQSTR:
if (grub_script_argv_append (&result, arg->str))
if (append (arg->str, 1))
goto fail;
break;
}

View File

@ -31,3 +31,11 @@ echo foo -n
echo foo -n -e
echo -------
if test -n "$grubshell"; then insmod regexp; fi
echo '*'
echo "*"
foo="*"
echo "$foo"