luci-base: introduce luci.util.shellquote()
authorJo-Philipp Wich <jo@mein.io>
Thu, 5 Apr 2018 07:29:38 +0000 (09:29 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 5 Apr 2018 07:37:43 +0000 (09:37 +0200)
commit45cefe71f6069b088e14dd913eb382816acb945c
tree5f77a2ef3b7906d23ccff4760b2d35c80b3de531
parent9e4b8a91384562e3baee724a52b72e30b1aa006d
luci-base: introduce luci.util.shellquote()

Introduce a new function luci.util.shellquote() which encloses the given
string argument in single quotes and escapes any embedded single quote
characters.

This function is intended to be used when interpolating untrusted input
into shell commands.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/luasrc/util.lua
modules/luci-base/luasrc/util.luadoc