mod_auth_dovecot: Add a dependency to util.pposix to send the _real_ pid

Fri, 28 Mar 2014 19:08:00 +0100

author
benjamin.podszun@gmail.com
date
Fri, 28 Mar 2014 19:08:00 +0100
changeset 1372
a573d64968e9
parent 1371
945784087d27
child 1373
985bfc6e8cad

mod_auth_dovecot: Add a dependency to util.pposix to send the _real_ pid

mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua file | annotate | diff | comparison | revisions
--- a/mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua	Mon Mar 24 13:04:44 2014 +0100
+++ b/mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua	Fri Mar 28 19:08:00 2014 +0100
@@ -32,6 +32,7 @@
 local jid_escape = require "util.jid".escape;
 local prepped_split = require "util.jid".prepped_split;
 local nodeprep = require "util.encodings".stringprep.nodeprep;
+local pposix = require "util.pposix";
 
 --module "sasl_dovecot"
 local _M = {};
@@ -67,7 +68,7 @@
 	end
 
 	-- Send our handshake
-	pid = tonumber(tostring(conn):match("0x%x*$"));
+	pid = pposix.getpid();
 	log("debug", "sending handshake to dovecot. version 1.1, cpid '%d'", pid);
 	local success,err = conn:send("VERSION\t1\t1\n");
 	if not success then

mercurial