[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
+ 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?


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 
             mu_diag_output (MU_DIAG_DEBUG, "got EOF");
-      if (len == 0)
-        {
-          imap4d_bye (ERR_NO_IFILE);
-          /*FIXME rc = ECONNABORTED;*/
-        }
       if (pnbytes)
        *pnbytes = len;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]