Created
January 12, 2018 10:32
-
-
Save kousu/af2ce63a590e56c38795f9564586c6bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r 933049a60ce6 mod_auth_external/mod_auth_external.lua | |
--- a/mod_auth_external/mod_auth_external.lua Thu Jan 04 11:41:54 2018 +0100 | |
+++ b/mod_auth_external/mod_auth_external.lua Fri Jan 12 05:26:22 2018 -0500 | |
@@ -75,6 +75,15 @@ | |
log("debug", "Started auth process"); | |
end | |
+ -- Hotfix: lpty has a glitch in some versions: no_local_echo=true is not respected until *after* | |
+ -- the first read happens, it seems. The first do_query() therefore fails because it reads | |
+ -- back the query that was sent in, so the first login after restarting prosody -- or after | |
+ -- any time the auth process crashes -- mysteriously fails. | |
+ -- By calling read() immediately and discarding the result, we skip the problem; | |
+ -- The protocol says that this first read should be empty, since the subprocess shouldn't | |
+ -- be giving us any data until we probe it. | |
+ pty:read(read_timeout); | |
+ | |
pty:send(text); | |
if blocking then | |
return pty:read(read_timeout); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment