[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-mailutils] imap4d --foreground and DIGEST-MD5 buglet
From: |
Simon Josefsson |
Subject: |
[bug-mailutils] imap4d --foreground and DIGEST-MD5 buglet |
Date: |
Thu, 24 Sep 2009 14:35:45 +0200 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) |
When testing imap4d --foreground with DIGEST-MD5 (which has an empty
final client response) I ran into this output:
address@hidden:~/src/mailutils/imap4d master$ ./imap4d --config-file
/home/jas/src/www-gsasl/test-server/imap4d.rc --foreground
* OK IMAP4rev1 Debugging mode
. AUTHENTICATE DIGEST-MD5
+
cmVhbG09Im1vY2NhLmpvc2Vmc3Nvbi5vcmciLCBub25jZT0iMktWakJ6dEFCSnl6YkREQ0xjeEd6dz09IiwgcW9wPSJhdXRoIiwgY2hhcnNldD11dGYtOCwgYWxnb3JpdGhtPW1kNS1zZXNz
dXNlcm5hbWU9InVzZXIiLCByZWFsbT0ibW9jY2Euam9zZWZzc29uLm9yZyIsIG5vbmNlPSIyS1ZqQnp0QUJKeXpiRERDTGN4R3p3PT0iLCBjbm9uY2U9ImNHLzlMOWN0UlZmRjVxanN1OHZlK3c9PSIsIG5jPTAwMDAwMDAxLCBxb3A9YXV0aCwgZGlnZXN0LXVyaT0iaW1hcC9udWJiLmpvc2Vmc3Nvbi5vcmciLCByZXNwb25zZT1mMTkwM2M4MjBkNjZjMWVmMTQxMDVjNzg0ZWFiYzFlZCwgY2hhcnNldD11dGYtOA==
+ cnNwYXV0aD1iNWYzZDhmYTcwZDQzMmJlZTBiYzJkMTk1ZDhkMThjNg==
address@hidden:~/src/mailutils/imap4d master$
In the syslog it said:
Sep 24 14:02:43 mocca imap4d[8191]: read error on control stream
The reason is imap4d_getline in imap4d/util.c:
if (len == 0)
{
imap4d_bye (ERR_NO_IFILE);
/*FIXME rc = ECONNABORTED;*/
}
This seems wrong -- sometimes (as in the example above) the expected
data from the client can be zero-size.
I checked, and imap4d_getline is only used by auth_gsasl.c and
auth_gss.c. Accepting zero-size responses appears OK in both
situations, but also used by imap4d_idle. As far as I can tell, that
code could handle a zero-size response, but I'm not certain.
How about this patch?
/Simon
diff --git a/imap4d/util.c b/imap4d/util.c
index 8350de0..ad64aa0 100644
--- a/imap4d/util.c
+++ b/imap4d/util.c
@@ -1383,11 +1383,6 @@ imap4d_getline (char **pbuf, size_t *psize, size_t
*pnbytes)
else
mu_diag_output (MU_DIAG_DEBUG, "got EOF");
}
- if (len == 0)
- {
- imap4d_bye (ERR_NO_IFILE);
- /*FIXME rc = ECONNABORTED;*/
- }
if (pnbytes)
*pnbytes = len;
}