2017-02-02 21:36 GMT+01:00 Mathieu Parent <math.par...@gmail.com>: > 2017-02-02 20:36 GMT+01:00 Michael Meskes <mes...@debian.org>: >>> Sorry, my patch was wrong >>> >>> local _, unix = pcall(require, "socket.unix"); >>> if unix then >>> socket.unix = unix.stream or unix.tcp; >>> end >>> >> >> This one seems to work. Great, thank you so much. >> >>> Unfortunately I can't really test the patches I propose, so I beg >>> your >>> pardon if they are wrong. >> >> No worries, I'm more than willing to test. Not speaking lua myself I >> cannot create a patch. All the more reason to be thankful for your >> work. >> >>> And the patches are really for the upstream of prosody-modules, not >>> for >>> Debian. >> >> Sure, I'll forward. > > Thanks Enrico. I've done a similar patch (attached). Note that with > your patch unix will always be not nil: if there is an error "_" will > be false, and unix will be the error string. > > Michael, can you test my patch?
Here is an updated version of the patch, targeting upstream. Can you try the attached patch with both lua-socket versions? - 3.0~rc1+git+321c0c9-2 - 3.0~rc1+git+ac3201d-3 Regards -- Mathieu
From 2fc74451bb344ea6dec8cbd0126b7dfc315b91a0 Mon Sep 17 00:00:00 2001 From: Mathieu Parent <math.par...@gmail.com> Date: Wed, 25 Jan 2017 20:42:56 +0100 Subject: [PATCH] Fix compatibility problems with Unix domain sockets in newer versions of luasocket --- mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua b/mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua index a6f1958..5747b8e 100644 --- a/mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua +++ b/mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua @@ -26,7 +26,14 @@ local m_random = math.random; local tostring, tonumber = tostring, tonumber; local socket = require "socket" -pcall(require, "socket.unix"); +local ok, unix = pcall(require, "socket.unix") +if ok then + if type(unix) == "function" then + socket.unix = unix + else + socket.unix = unix.stream or unix.tcp + end +end local base64 = require "util.encodings".base64; local b64, unb64 = base64.encode, base64.decode; local jid_escape = require "util.jid".escape; -- 2.11.0