Cyrus seems to be fairly inconsistent in its use of assert() tests. 37 of the .c files use the builtin Cyrus assert(), defined by:

  #include "assert.h"

While 23 .c source files use the system assert() macro, defined by:

  #include <assert.h>

The system assert() function sends a message to stderr and then calls abort(). This sends the error verbatim to an IMAP/POP/LMTP client:

  . LIST "" *
  imapd: cyrusdb_skiplist.c:913: myfetch: Assertion `2 + 2 == 5' failed.

Nothing is sent to syslog.

In contrast the internal assert() sends the error to fatal(). IMAP, POP and LMTP daemons would send more appropriate error back to the clients:

  . LIST "" *
  * BYE Fatal error: Internal error: assertion failed:
                     cyrusdb_skiplist.c: 913: 2 + 2 == 5

  MAIL FROM:<dpc22>
  250 2.1.0 ok
  RCPT TO:<dpc22>
  421 4.3.0 lmtpd: Internal error: assertion failed:
                   cyrusdb_skiplist.c: 913: 2 + 2 == 5

The error text is also sent to syslog() before a proper shut_down().

Here is a simple patch to change all of the '#include <assert.h>' into '#include "assert.h"':

http://www-uxsup.csx.cam.ac.uk/~dpc22/cyrus/patches/2.3cvs/assert.patch

--
David Carter                             Email: [EMAIL PROTECTED]
University Computing Service,            Phone: (01223) 334502
New Museums Site, Pembroke Street,       Fax:   (01223) 334679
Cambridge UK. CB2 3QH.

Reply via email to