From c09bd4346b20cce04769111b0d2c8c93383eebe5 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 30 Nov 2017 18:47:06 +0000 Subject: prosodyctl: Fix traceback with lfs < 1.6.2 and show warning --- prosodyctl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prosodyctl b/prosodyctl index eaccf1d9..c4f51f35 100755 --- a/prosodyctl +++ b/prosodyctl @@ -947,6 +947,9 @@ function commands.cert(arg) if pposix.getuid() ~= cert_dir_attrs.uid then show_warning("The directory "..cert_basedir.." is not owned by the current user, won't be able to write files to it"); return 1; + elseif not cert_dir_attrs.permissions then -- COMPAT with LuaFilesystem < 1.6.2 (hey CentOS!) + show_message("Unable to check permissions on "..cert_basedir.." (LuaFilesystem 1.6.2+ required)"); + show_message("Please confirm that Prosody (and only Prosody) can write to this directory)"); elseif cert_dir_attrs.permissions:match("^%.w..%-..%-.$") then show_warning("The directory "..cert_basedir.." not only writable by its owner"); return 1; -- cgit v1.2.3 From 548520243970753f04199de1ff8dae3f8c3cfd1a Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 30 Nov 2017 19:35:35 +0100 Subject: util.signal: Fix loop (fixes #1047) A pre-commit version probably started with i = nsig and counted down, then an incomplete change to counting up was done --- util-src/signal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util-src/signal.c b/util-src/signal.c index b94beffa..9e6f6f63 100644 --- a/util-src/signal.c +++ b/util-src/signal.c @@ -172,7 +172,7 @@ static void sighook(lua_State *L, lua_Debug *ar) { lua_pushstring(L, LUA_SIGNAL); lua_gettable(L, LUA_REGISTRYINDEX); - for(int i = 1; i <= nsig; i--) { + for(int i = 0; i < nsig; i++) { lua_pushnumber(L, signals[i]); lua_gettable(L, -2); lua_call(L, 0, 0); @@ -196,7 +196,7 @@ static void handle(int sig) { } if(nsig < MAX_PENDING_SIGNALS) { - signals[++nsig] = sig; + signals[nsig++] = sig; } } -- cgit v1.2.3 From 066b90ccffc05ecc98df624c7b8a1a97ae526dc9 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 1 Dec 2017 04:50:20 +0100 Subject: net.dns: Don't compress a single zero group in IPv6 addresses to match behaviour of inet_ntop --- net/dns.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dns.lua b/net/dns.lua index 5ba3db0e..eba2b5a0 100644 --- a/net/dns.lua +++ b/net/dns.lua @@ -390,7 +390,7 @@ function resolver:AAAA(rr) end addr = table.concat(addr, ":"):gsub("%f[%x]0+(%x)","%1"); local zeros = {}; - for item in addr:gmatch(":[0:]+:") do + for item in addr:gmatch(":[0:]+:[0:]+:") do table.insert(zeros, item) end if #zeros == 0 then -- cgit v1.2.3