aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-12-23 08:42:02 +0100
committerKim Alvefur <zash@zash.se>2015-12-23 08:42:02 +0100
commite5c46ff2b928462b7eaadcd841252c79fb08c168 (patch)
tree115a0ecbf0c4be1bff88c6200786823fc70e9a6b
parentf0cb003a5a6e8c006faf9c6e750d70a787d65b27 (diff)
downloadprosody-e5c46ff2b928462b7eaadcd841252c79fb08c168.tar.gz
prosody-e5c46ff2b928462b7eaadcd841252c79fb08c168.zip
util.openssl: Move quoting and tostring call into escape function
-rw-r--r--util/openssl.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/openssl.lua b/util/openssl.lua
index 39fe99d6..5043e368 100644
--- a/util/openssl.lua
+++ b/util/openssl.lua
@@ -144,7 +144,7 @@ end
do -- Lua to shell calls.
local function shell_escape(s)
- return s:gsub("'",[['\'']]);
+ return "'" .. tostring(s):gsub("'",[['\'']]) .. "'";
end
local function serialize(f,o)
@@ -153,12 +153,12 @@ do -- Lua to shell calls.
if type(k) == "string" then
t_insert(r, ("-%s"):format(k));
if v ~= true then
- t_insert(r, ("'%s'"):format(shell_escape(tostring(v))));
+ t_insert(r, shell_escape(v));
end
end
end
for _,v in ipairs(o) do
- t_insert(r, ("'%s'"):format(shell_escape(tostring(v))));
+ t_insert(r, shell_escape(v));
end
return t_concat(r, " ");
end