mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
sh: Reject function names ending in one of !%*+-=?@}~
These do something else in ksh: name=(...) is an array or compound variable assignment and the others are extended patterns. This is the last patch of the ones tested in the exp run. Exp-run done by: pav (with some other sh(1) changes)
This commit is contained in:
parent
a12be66e86
commit
a1251487f4
1 changed files with 5 additions and 1 deletions
|
|
@ -644,9 +644,13 @@ simplecmd(union node **rpp, union node *redir)
|
|||
/*
|
||||
* - Require plain text.
|
||||
* - Functions with '/' cannot be called.
|
||||
* - Reject name=().
|
||||
* - Reject ksh extended glob patterns.
|
||||
*/
|
||||
if (!noexpand(n->narg.text) || quoteflag ||
|
||||
strchr(n->narg.text, '/'))
|
||||
strchr(n->narg.text, '/') ||
|
||||
strchr("!%*+-=?@}~",
|
||||
n->narg.text[strlen(n->narg.text) - 1]))
|
||||
synerror("Bad function name");
|
||||
rmescapes(n->narg.text);
|
||||
if (find_builtin(n->narg.text, &special) >= 0 &&
|
||||
|
|
|
|||
Loading…
Reference in a new issue