diff --git a/app/switch/resources/scripts/app/servers/resources/clear_cache.lua b/app/switch/resources/scripts/app/servers/resources/clear_cache.lua index baca32b60..c96bd9f5b 100644 --- a/app/switch/resources/scripts/app/servers/resources/clear_cache.lua +++ b/app/switch/resources/scripts/app/servers/resources/clear_cache.lua @@ -24,13 +24,13 @@ end if (cmd == "flush") then - os.execute("rm " .. cache_dir .. "/*"); + os.execute("rm " .. shell_esc(cache_dir) .. "/*"); end if (cmd == "delete") then if (file ~= nil) then file = trim(file); - freeswitch.consoleLog("NOTICE","api_command: delete ".. cache_dir .. "/" .. file .. "\n"); + freeswitch.consoleLog("NOTICE","api_command: delete ".. shell_esc(cache_dir .. "/" .. file) .. "\n"); os.remove(cache_dir.."/"..file); end diff --git a/app/switch/resources/scripts/app/servers/resources/memcache.lua b/app/switch/resources/scripts/app/servers/resources/memcache.lua index 063417c60..e9807c2da 100644 --- a/app/switch/resources/scripts/app/servers/resources/memcache.lua +++ b/app/switch/resources/scripts/app/servers/resources/memcache.lua @@ -78,14 +78,14 @@ for key,row in pairs(servers) do if (row.method == "ssh") then api_command_argument = api_command_argument:gsub("%%20", " "); - cmd = [[ssh ]]..row.username..[[@]]..row.hostname..[[ "fs_cli -x 'memcache ]]..api_command_argument..[['"]]; + cmd = [[ssh ]]..row.username..[[@]]..row.hostname..[[ "fs_cli -x 'memcache ]]..shell_esc(api_command_argument)..[['"]]; freeswitch.consoleLog("INFO", "[notice] command: ".. cmd .. "\n"); os.execute(cmd); end if (row.method == "curl") then api_command_argument = api_command_argument:gsub(" ", "%%20"); url = [[http://]]..row.username..[[:]]..row.password..[[@]]..row.hostname..[[:]]..row.port..[[/webapi/memcache?]]..api_command_argument; - os.execute("curl "..url); + os.execute("curl "..shell_esc(url)); freeswitch.consoleLog("INFO", "[notice] curl ".. url .. " \n"); end end