Control: reassign -1 prosody-modules
Control: tag -1 + patch upstream confirmed


On Wed, 25 Jan 2017 13:04:02 +0100 Enrico Tassi
<gareuselesi...@debian.org> wrote:
> On Wed, Jan 25, 2017 at 10:24:25AM +0100, Michael Meskes wrote:
> > > Hopefully somebody is prepared to fix all rdepends.
> >
> > Or better reverts the API change.
>
> The bug is definitely important.
>
> Mathieu can you take care of it?

Can you test the attached patch on prosody-modules? It's future-proof
and inspired by Courtney's patch on ekeyd.

Regards.

Mathieu Parent
From 6e1199cd1b19361a03bbd2d2243246bd1f75921b 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

Inspired by a similar patch on ekeyd by Courtney Bane.
---
 mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua b/mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua
index a6f1958..8e2f1cf 100644
--- a/mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua
+++ b/mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua
@@ -26,7 +26,11 @@ local m_random = math.random;
 local tostring, tonumber = tostring, tonumber;
 
 local socket = require "socket"
-pcall(require, "socket.unix");
+function tryload_unix()
+   socket.unix = require "socket.unix"
+end
+pcall(tryload_unix);
+local sock = socket.unix.stream or socket.unix.tcp or socket.unix
 local base64 = require "util.encodings".base64;
 local b64, unb64 = base64.encode, base64.decode;
 local jid_escape = require "util.jid".escape;
@@ -54,9 +58,9 @@ local function connect(socket_info)
 		conn = socket.tcp();
 		ok, err = conn:connect(socket_host, socket_port);
 		socket_path = ("%s:%d"):format(socket_host, socket_port);
-	elseif socket.unix then
+	elseif sock then
 		socket_path = socket_info;
-		conn = socket.unix();
+		conn = sock();
 		ok, err = conn:connect(socket_path);
 	else
 		err = "luasocket was not compiled with UNIX sockets support";
-- 
2.11.0

Reply via email to