diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2018-03-07 18:25:27 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2018-03-07 18:25:27 +0000 |
commit | 697f127dd6427aa5161ad92826e2a7d6796843a0 (patch) | |
tree | bd1024c6af6f4999f556c03b68bdefdf8374ca53 /stand/lua/cli.lua | |
parent | 490768e24ab73c8e4ac0c3dc01d3d43028fee0c4 (diff) | |
download | src-697f127dd6427aa5161ad92826e2a7d6796843a0.tar.gz src-697f127dd6427aa5161ad92826e2a7d6796843a0.zip |
lualoader: Expose loader.parse and add cli_execute_unparsed
This will be used for scenarios where the command to execute is coming in
via the environment (from, for example, loader.conf(5)) and is thus not
necessarily trusted.
cli_execute_unparsed will immediately be used for handling
module_{before,after,error} as well as menu_timeout_command. We still want
to offer these variables the ability to execute Lua-intercepted loader
commands, but we don't want them to be able to execute arbitrary Lua.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D14580
Notes
Notes:
svn path=/head/; revision=330616
Diffstat (limited to 'stand/lua/cli.lua')
-rw-r--r-- | stand/lua/cli.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/stand/lua/cli.lua b/stand/lua/cli.lua index d6c3a54b9bf9..ac992d9196e1 100644 --- a/stand/lua/cli.lua +++ b/stand/lua/cli.lua @@ -94,6 +94,10 @@ function cli_execute(...) end +function cli.execute_unparsed(str) + cli_execute(loader.parse(str)) +end + -- Module exports function cli.boot(...) |