luci-app-openvpn: quote grep expression in getPID()
authorJo-Philipp Wich <jo@mein.io>
Fri, 6 Apr 2018 21:37:38 +0000 (23:37 +0200)
committerJo-Philipp Wich <jo@mein.io>
Fri, 6 Apr 2018 21:38:38 +0000 (23:38 +0200)
Fixes c0d9c4f3c ("treewide: filter shell arguments through shellquote() where applicable")

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-openvpn/luasrc/model/cbi/openvpn.lua

index ccad531..52ba9e3 100644 (file)
@@ -26,7 +26,7 @@ uci:foreach( "openvpn_recipes", "openvpn_recipe",
 )
 
 function s.getPID(section) -- Universal function which returns valid pid # or nil
 )
 
 function s.getPID(section) -- Universal function which returns valid pid # or nil
-       local pid = sys.exec("%s | grep -w [o]penvpn(%s)" % { psstring, section })
+       local pid = sys.exec("%s | grep -w '[o]penvpn(%s)'" % { psstring, section })
        if pid and #pid > 0 then
                return tonumber(pid:match("^%d+"))
        else
        if pid and #pid > 0 then
                return tonumber(pid:match("^%d+"))
        else