Changeset

1157:a7d0d129df6f

mod_auth_external: Log full response from pty if it appears to be an error message
author Matthew Wild <mwild1@gmail.com>
date Tue, 13 Aug 2013 21:37:05 +0100
parents 1156:3c82984ffa51
children 1158:ae1767b54964
files mod_auth_external/mod_auth_external.lua
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mod_auth_external/mod_auth_external.lua	Tue Aug 13 20:01:33 2013 +0100
+++ b/mod_auth_external/mod_auth_external.lua	Tue Aug 13 21:37:05 2013 +0100
@@ -67,9 +67,7 @@
 			return true;
 	else
 		if response then
-			log("warn", "Unable to interpret data from auth process, %d bytes beginning with: %s", #response, (response:sub(1,4):gsub(".", function (c)
-				return ("%02X "):format(c:byte());
-			end)));
+			log("warn", "Unable to interpret data from auth process, %s", (response:match("^error:") and response) or ("["..#response.." bytes]"));
 		else
 			log("warn", "Error while waiting for result from auth process: %s", response or "unknown error");
 		end