Subject: Bug in c-client's imap_status() call?

From: "Jaldhar H. Vyas" <[email-masked]>
Date: Sat, 25 Aug 2001 22:18:49 -0400 (EDT)

I received the following bug report from a Debian user.  Mark, what do you
think?

---------- Forwarded message ----------
Ahoy.

I stumbled upon a rather annoying bug in the c-client library the other
day.  It seems checking the status of an IMAP mailbox with imap_status()
will lead to a new connection regardless of whether or not you supply it
a valid one to use.

This inevitably results in inetd spawning dozens of imapd processes and
eventually shutting it down entirely.  Euck.

The offending code (in src/c-client/imap4r1.c lines 488-490):

  if (stream && (!(LEVELSTATUS (stream) || stream->halfopen)
                   || mail_usable_network_stream (stream,mbx)))
	return imap_status (NIL,mbx,flags);

Of which one byte needs to be changed:

  if (stream && (!(LEVELSTATUS (stream) || stream->halfopen)
                   || !mail_usable_network_stream (stream,mbx)))
	return imap_status (NIL,mbx,flags);

(Notice the exclamation mark.)

-- 
Jaldhar H. Vyas <[email-masked]>

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Sat, 25 Aug 2001 22:30:00 -0700 (PDT)

Thank you for reporting this problem.  The analysis and suggested fix are
correct.  This fix will be in the final distribution of imap-2001 and of Pine
4.40.