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?

Regards

-- 
Mathieu
From a484836665572151199954928c352215d075ef63 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 | 5 ++++-
 1 file changed, 4 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..66b15d9 100644
--- a/mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua
+++ b/mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua
@@ -26,7 +26,10 @@ 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
+    socket.unix = unix.stream or unix.tcp or unix
+end
 local base64 = require "util.encodings".base64;
 local b64, unb64 = base64.encode, base64.decode;
 local jid_escape = require "util.jid".escape;
-- 
2.11.0

Reply via email to