util.openssl: remove unused one-letter loop variable [luacheck]
[prosody.git] / util / openssl.lua
index 12e49eac2ef5efa8f96c266a758f72ad327ef3f0..abd90a849a79c46e37f313e357a8b37fde811bb0 100644 (file)
@@ -70,8 +70,7 @@ function ssl_config:serialize()
                                end
                        end
                elseif k == "distinguished_name" then
-                       for i=1, #DN_order do
-                               local k = DN_order[i]
+                       for _, k in ipairs(t[1] and t or DN_order) do
                                local v = t[k];
                                if v then
                                        s = s .. ("%s = %s\n"):format(k, v);
@@ -167,7 +166,8 @@ do -- Lua to shell calls.
        setmetatable(_M, {
                __index = function(_, command)
                        return function(opts)
-                               return 0 == os_execute(serialize(command, type(opts) == "table" and opts or {}));
+                               local ret = os_execute(serialize(command, type(opts) == "table" and opts or {}));
+                               return ret == true or ret == 0;
                        end;
                end;
        });