# HG changeset patch # User Waqas Hussain # Date 1508036642 14400 # Node ID e9ca7fd4ad063471f7d4690177621f1a34387297 # Parent 44e5adbb6ac036ac3d74a1bd224786be4f064572 mod_auth_dovecot: Support new luasocket unix domain socket API (fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=852250 in Debian Stretch) diff -r 44e5adbb6ac0 -r e9ca7fd4ad06 mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua --- a/mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua Sat Oct 14 18:43:23 2017 +0200 +++ b/mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua Sat Oct 14 23:04:02 2017 -0400 @@ -26,7 +26,13 @@ local tostring, tonumber = tostring, tonumber; local socket = require "socket" -pcall(require, "socket.unix"); + +local unix_success, unix = pcall(require, "socket.unix"); +if unix_success and unix and not socket.unix then + -- COMPAT map new luasocket API to old + socket.unix = unix.stream or unix.tcp; +end + local base64 = require "util.encodings".base64; local b64, unb64 = base64.encode, base64.decode; local jid_escape = require "util.jid".escape;