Closed kousu closed 6 years ago
I may have seen this a second time post-boot. I logged in successfully on one account, but then two different accounts, trying with Gajim and oJSXC, momentarily reported incorrect passwords. But I didn't catch the logs to go with it so this is just a bit better than hearsay. I don't know if this is because xcauth crashed and was restarted by Prosody or if there's something deeper. I mean, I have no explanation for why this message happens at all.
This is not a bug in xmpp-cloud-auth. I wrote my own implementation because I was frustrated with the glitch, and got the exact same error message about the 62 bytes.
It must be something involving lpty.
For the record, it is lpty. I added more logging to mod_auth_external
and now I see:
Jan 12 05:03:41 sunflowercollective.org prosody[6661]: sunflowercollective.org:auth_external: Started auth process
Jan 12 05:03:41 sunflowercollective.org prosody[6661]: sunflowercollective.org:auth_external: Got response from auth provider:
Jan 12 05:03:41 sunflowercollective.org prosody[6661]: sunflowercollective.org:auth_external: auth:kousu:sunflowercollective.org:***************************
Jan 12 05:03:41 sunflowercollective.org prosody[6661]: sunflowercollective.org:auth_external: ----------------
Jan 12 05:03:41 sunflowercollective.org prosody[6661]: sunflowercollective.org:auth_external: Unable to interpret data from auth process, [62 bytes]
lpty is copying its input to its output, even though no_local_echo = true
in the settings. Its README has a dismissive warning about this:
The local echo thing
As written in the description of the no_local_echo flag, this may not always work as expected. Programs are free to set their terminals to whatever settings they like, and indeed some programs do, or even completely roll their own local echo policy. The most notable piece of code to do this is Gnu readline, though it seems that this does not happen for all versions of it. On Mac OS X, it certainly does, whereas on my Ubuntu Box it does not. So if you write something using lpty that is supposed to be used on different unixen, you better not rely on no_local_echo to do what you think it should.
And apparently you already fixed this: https://github.com/jsxc/xmpp-cloud-auth/commit/0d0154f66bdda50b40846491cfc9c63a8c0f9311#diff-c33707595019efa87a2ea715407721ea
Duplicate of #21
@kousu Thanks for lpty investigation and your clever fix in Prosody issue 855
I installed xcauth on my server (as in #44) and I find that the first time I try to connect I get Unable to interpret data from auth process, [62 bytes] in my prosody logs:
But if I sign in a second time immediately after I get
I sniffed the conversation prosody is having with xcauth and all I see is
The first auth line fails, the second succeeds. I don't know what 62 bytes could refer to; it's also a consistent 62 bytes. Do you have a clue? Have you seen this?
Maybe this is actually a bug in mod_auth_external.