Changeset

267:76f3310ec113

mod_auth_dovecot: Use PID in handshake
author Javier Torres <javitonino@gmail.com>
date Sat, 30 Oct 2010 23:38:19 +0200
parents 265:8cd2fab3135a
children 268:cfcd4efb0fa4
files mod_auth_dovecot/mod_auth_dovecot.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_auth_dovecot/mod_auth_dovecot.lua	Sat Oct 16 08:09:48 2010 +0500
+++ b/mod_auth_dovecot/mod_auth_dovecot.lua	Sat Oct 30 23:38:19 2010 +0200
@@ -11,6 +11,7 @@
 local new_sasl = require "util.sasl".new;
 local nodeprep = require "util.encodings".stringprep.nodeprep;
 local base64 = require "util.encodings".base64;
+local pposix = require "util.pposix";
 
 local prosody = _G.prosody;
 
@@ -24,7 +25,7 @@
 		c = assert(socket.unix());
 		assert(c:connect("/var/run/dovecot/auth-login")); -- FIXME: Hardcoded is bad
 		
-		local pid = "12345"; -- FIXME: this should be an unique number between processes, recommendation is PID
+		local pid = pposix.getpid();
 
 		-- Send our handshake
         -- FIXME: Oh no! There are asserts everywhere