[SVN] r418 - in /branches/idled: ./ cmulocal/ debian/patches/ doc/ imap/ imtest/ installsieve/ lib/ man/ master/ notifyd/ perl/ perl/sieve/ perl/sieve/lib/ ptclient/ sieve/ timsieved/

debian at incase.de debian at incase.de
Sat May 6 12:53:41 UTC 2006


Author: sven
Date: Sat May  6 14:53:33 2006
New Revision: 418

URL: https://mail.incase.de/viewcvs?rev=418&root=cyrus22&view=rev
Log:
Fix a typo in imap/idle.c ("}" instead of ")" needed

Modified:
    branches/idled/Makefile.in
    branches/idled/cmulocal/cyrus.m4
    branches/idled/configure.in
    branches/idled/debian/patches/23-configurable_idled.dpatch
    branches/idled/doc/changes.html
    branches/idled/doc/faq.html
    branches/idled/doc/install-virtdomains.html
    branches/idled/imap/Makefile.in
    branches/idled/imap/backend.c
    branches/idled/imap/ctl_mboxlist.c
    branches/idled/imap/deliver.c
    branches/idled/imap/fetchnews.c
    branches/idled/imap/fud.c
    branches/idled/imap/global.c
    branches/idled/imap/idle_idled.c
    branches/idled/imap/imapd.c
    branches/idled/imap/index.c
    branches/idled/imap/lmtpd.c
    branches/idled/imap/mbdump.c
    branches/idled/imap/mboxlist.h
    branches/idled/imap/message.c
    branches/idled/imap/mupdate-client.c
    branches/idled/imap/mupdate.c
    branches/idled/imap/mupdate.h
    branches/idled/imap/nntpd.c
    branches/idled/imap/pop3d.c
    branches/idled/imap/proxyd.c
    branches/idled/imap/quota.c
    branches/idled/imap/reconstruct.c
    branches/idled/imap/signals.c
    branches/idled/imap/spool.c
    branches/idled/imap/tls.c
    branches/idled/imap/xversion.sh
    branches/idled/imtest/imtest.c
    branches/idled/installsieve/Makefile.in
    branches/idled/lib/Makefile.in
    branches/idled/lib/acl_afs.c
    branches/idled/lib/imapoptions
    branches/idled/lib/imclient.c
    branches/idled/lib/lock.h
    branches/idled/lib/lock_fcntl.c
    branches/idled/lib/lock_flock.c
    branches/idled/lib/map_stupidshared.c
    branches/idled/lib/xmalloc.h
    branches/idled/man/chk_cyrus.8
    branches/idled/man/ctl_cyrusdb.8
    branches/idled/man/ctl_deliver.8
    branches/idled/man/ctl_mboxlist.8
    branches/idled/man/cyr_expire.8
    branches/idled/man/cyrus.conf.5
    branches/idled/man/deliver.8
    branches/idled/man/fud.8
    branches/idled/man/idled.8
    branches/idled/man/imapd.8
    branches/idled/man/lmtpd.8
    branches/idled/man/master.8
    branches/idled/man/nntpd.8
    branches/idled/man/notifyd.8
    branches/idled/man/pop3d.8
    branches/idled/man/quota.8
    branches/idled/man/reconstruct.8
    branches/idled/man/smmapd.8
    branches/idled/man/timsieved.8
    branches/idled/man/tls_prune.8
    branches/idled/master/CYRUS-MASTER.mib
    branches/idled/master/Makefile.in
    branches/idled/master/master.c
    branches/idled/master/master.h
    branches/idled/master/masterconf.c
    branches/idled/notifyd/Makefile.in
    branches/idled/notifyd/notifyd.c
    branches/idled/perl/Makefile.in
    branches/idled/perl/sieve/Makefile.in
    branches/idled/perl/sieve/lib/Makefile.in
    branches/idled/ptclient/ptexpire.c
    branches/idled/ptclient/test.c
    branches/idled/ptclient/test2.c
    branches/idled/sieve/Makefile.in
    branches/idled/sieve/md5.c
    branches/idled/timsieved/Makefile.in
    branches/idled/timsieved/actions.c

Modified: branches/idled/Makefile.in
URL: https://mail.incase.de/viewcvs/branches/idled/Makefile.in?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/Makefile.in (original)
+++ branches/idled/Makefile.in Sat May  6 14:53:33 2006
@@ -41,7 +41,7 @@
 # 
 
 SUBDIRS = man @PRE_SUBDIRS@ lib @SIEVE_SUBDIRS@ @SERVER_SUBDIRS@ \
-	imtest @SNMP_SUBDIRS@ @EXTRA_SUBDIRS@
+	imtest perl @SNMP_SUBDIRS@ @EXTRA_SUBDIRS@
 DISTSUBDIRS = doc
 
 srcdir = @srcdir@

Modified: branches/idled/cmulocal/cyrus.m4
URL: https://mail.incase.de/viewcvs/branches/idled/cmulocal/cyrus.m4?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/cmulocal/cyrus.m4 (original)
+++ branches/idled/cmulocal/cyrus.m4 Sat May  6 14:53:33 2006
@@ -3,6 +3,7 @@
 dnl $Id: cyrus.m4,v 1.4 2003/10/08 20:35:24 rjs3 Exp $
 dnl tjs at andrew.cmu.edu 6-may-1998
 dnl
+dnl Debian fix (hmh at debian.org): We don't want runpath set in Debian
 
 dnl It would be good if ANDREW_ADD_LIBPATH could detect if something was
 dnl already there and not redundantly add it if it is.
@@ -30,16 +31,8 @@
 ])
 
 dnl runpath initialization
+dnl (disabled by hmh at debian.org
 AC_DEFUN([CMU_GUESS_RUNPATH_SWITCH], [
    # CMU GUESS RUNPATH SWITCH
-  AC_CACHE_CHECK(for runpath switch, andrew_runpath_switch, [
-    # first, try -R
-    SAVE_LDFLAGS="${LDFLAGS}"
-    LDFLAGS="-R /usr/lib"
-    AC_TRY_LINK([],[],[andrew_runpath_switch="-R"], [
-  	LDFLAGS="-Wl,-rpath,/usr/lib"
-    AC_TRY_LINK([],[],[andrew_runpath_switch="-Wl,-rpath,"],
-    [andrew_runpath_switch="none"])
-    ])
-  LDFLAGS="${SAVE_LDFLAGS}"
-  ])])
+    andrew_runpath_switch="none"
+])

Modified: branches/idled/configure.in
URL: https://mail.incase.de/viewcvs/branches/idled/configure.in?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/configure.in (original)
+++ branches/idled/configure.in Sat May  6 14:53:33 2006
@@ -50,6 +50,11 @@
 AC_PREREQ([2.54])
 AC_CONFIG_HEADER(config.h)
 AC_CANONICAL_HOST
+
+dnl Useful for maintainer mode stuff
+WARNERROR=-W
+AC_ARG_ENABLE(warnings-are-errors,[  --enable-warnings-are-errors   add -Werror to most gcc calls], [ if test "$enableval" != "no" ; then WARNERROR=-Werror ; fi ])
+AC_SUBST(WARNERROR)
 
 dnl Useful hook for distributions
 AC_ARG_WITH(extraident,[  --with-extraident=STRING   use STRING as extra version information],
@@ -94,10 +99,12 @@
 AC_ISC_POSIX
 AC_PROG_AWK
 AC_C_CONST
-AC_SYS_LONG_FILE_NAMES
-if test $ac_cv_sys_long_file_names = no; then
-	AC_MSG_ERROR(The Cyrus IMAPD requires support for long file names)
-fi
+dnl fakeroot sometimes fails this test
+dnl and Debian always supports long filenames anyway
+dnl AC_SYS_LONG_FILE_NAMES
+dnl if test $ac_cv_sys_long_file_names = no; then
+dnl	AC_MSG_ERROR(The Cyrus IMAPD requires support for long file names)
+dnl fi
 AC_C_INLINE
 
 CMU_C___ATTRIBUTE__
@@ -1202,7 +1209,11 @@
     SQUAT_ENGINE = 1,
 
     /* should we have long LMTP error messages? */
-    LMTP_LONG_ERROR_MSGS = 1
+    LMTP_LONG_ERROR_MSGS = 1,
+
+    /* default time to wait, in seconds, before giving up
+     * trying to lock something */
+    LOCK_GIVEUP_TIMER_DEFAULT = 100
 };
 
 #endif /* _CYRUS_IMAPD_CONFIG_H_ */

Modified: branches/idled/debian/patches/23-configurable_idled.dpatch
URL: https://mail.incase.de/viewcvs/branches/idled/debian/patches/23-configurable_idled.dpatch?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/debian/patches/23-configurable_idled.dpatch (original)
+++ branches/idled/debian/patches/23-configurable_idled.dpatch Sat May  6 14:53:33 2006
@@ -5,9 +5,9 @@
 ## DP: Adds imapd.conf option to select IDLE method at runtime
 
 @DPATCH@
-diff -urNad idled/configure.in /tmp/dpep.cbgbWp/idled/configure.in
---- idled/configure.in	2006-05-06 12:54:13.000000000 +0200
-+++ /tmp/dpep.cbgbWp/idled/configure.in	2006-05-06 12:54:35.058909068 +0200
+diff -urNad idled/configure.in /tmp/dpep.JGdoug/idled/configure.in
+--- idled/configure.in	2006-05-06 14:51:16.000000000 +0200
++++ /tmp/dpep.JGdoug/idled/configure.in	2006-05-06 14:51:18.163885333 +0200
 @@ -754,17 +754,6 @@
  AC_DEFINE_UNQUOTED(MASTER_PIDFILE, $MASTERPIDFILE,[Name of the pidfile for master])
  
@@ -26,9 +26,9 @@
  dnl see if we're compiling with NNTP support
  dnl
  ENABLE_NNTP=no
-diff -urNad idled/imap/Makefile.in /tmp/dpep.cbgbWp/idled/imap/Makefile.in
---- idled/imap/Makefile.in	2006-05-06 12:54:13.000000000 +0200
-+++ /tmp/dpep.cbgbWp/idled/imap/Makefile.in	2006-05-06 12:54:35.070907936 +0200
+diff -urNad idled/imap/Makefile.in /tmp/dpep.JGdoug/idled/imap/Makefile.in
+--- idled/imap/Makefile.in	2006-05-06 14:51:16.000000000 +0200
++++ /tmp/dpep.JGdoug/idled/imap/Makefile.in	2006-05-06 14:51:18.164885239 +0200
 @@ -47,9 +47,6 @@
  # 'local' (legacy flat file).
  SEEN=seen_db.o
@@ -58,9 +58,9 @@
  	fud smmapd reconstruct quota mbpath ipurge \
  	cyrdump chk_cyrus cvt_cyrusdb deliver ctl_mboxlist \
  	ctl_deliver ctl_cyrusdb squatter mbexamine cyr_expire arbitron \
-diff -urNad idled/imap/global.c /tmp/dpep.cbgbWp/idled/imap/global.c
---- idled/imap/global.c	2006-05-06 12:54:13.000000000 +0200
-+++ /tmp/dpep.cbgbWp/idled/imap/global.c	2006-05-06 12:54:35.059908974 +0200
+diff -urNad idled/imap/global.c /tmp/dpep.JGdoug/idled/imap/global.c
+--- idled/imap/global.c	2006-05-06 14:51:16.000000000 +0200
++++ /tmp/dpep.JGdoug/idled/imap/global.c	2006-05-06 14:51:18.164885239 +0200
 @@ -94,6 +94,8 @@
  /* syslog prefix tag */
  static char syslog_prefix[20];
@@ -81,9 +81,9 @@
  	/* configure libcyrus as needed */
  	libcyrus_config_setstring(CYRUSOPT_CONFIG_DIR, config_dir);
  	libcyrus_config_setswitch(CYRUSOPT_AUTH_UNIX_GROUP_ENABLE,
-diff -urNad idled/imap/global.h /tmp/dpep.cbgbWp/idled/imap/global.h
---- idled/imap/global.h	2006-04-23 22:37:08.000000000 +0200
-+++ /tmp/dpep.cbgbWp/idled/imap/global.h	2006-05-06 12:54:35.059908974 +0200
+diff -urNad idled/imap/global.h /tmp/dpep.JGdoug/idled/imap/global.h
+--- idled/imap/global.h	2006-05-06 14:51:15.000000000 +0200
++++ /tmp/dpep.JGdoug/idled/imap/global.h	2006-05-06 14:51:18.165885145 +0200
 @@ -152,4 +152,6 @@
  extern struct cyrusdb_backend *config_tlscache_db;
  extern struct cyrusdb_backend *config_ptscache_db;
@@ -91,9 +91,9 @@
 +extern struct idle_backend *config_idle;
 +
  #endif /* INCLUDED_GLOBAL_H */
-diff -urNad idled/imap/idle.c /tmp/dpep.cbgbWp/idled/imap/idle.c
+diff -urNad idled/imap/idle.c /tmp/dpep.JGdoug/idled/imap/idle.c
 --- idled/imap/idle.c	1970-01-01 01:00:00.000000000 +0100
-+++ /tmp/dpep.cbgbWp/idled/imap/idle.c	2006-05-06 12:54:35.060908880 +0200
++++ /tmp/dpep.JGdoug/idled/imap/idle.c	2006-05-06 14:52:45.950631259 +0200
 @@ -0,0 +1,85 @@
 +/* 
 + * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
@@ -159,7 +159,7 @@
 +    &idle_no,
 +    &idle_poll,
 +    &idle_idled,
-+    NULL );
++    NULL };
 +
 +struct idle_backend *idle_fromname(const char *name)
 +{
@@ -180,9 +180,9 @@
 +
 +    return idle;
 +}
-diff -urNad idled/imap/idle.h /tmp/dpep.cbgbWp/idled/imap/idle.h
---- idled/imap/idle.h	2006-04-23 22:37:08.000000000 +0200
-+++ /tmp/dpep.cbgbWp/idled/imap/idle.h	2006-05-06 12:54:35.060908880 +0200
+diff -urNad idled/imap/idle.h /tmp/dpep.JGdoug/idled/imap/idle.h
+--- idled/imap/idle.h	2006-05-06 14:51:15.000000000 +0200
++++ /tmp/dpep.JGdoug/idled/imap/idle.h	2006-05-06 14:51:18.165885145 +0200
 @@ -45,8 +45,6 @@
  
  #include "mailbox.h"
@@ -238,9 +238,9 @@
 +struct idle_backend *idle_fromname(const char *name);
  
  #endif
-diff -urNad idled/imap/idle_idled.c /tmp/dpep.cbgbWp/idled/imap/idle_idled.c
---- idled/imap/idle_idled.c	2006-05-06 12:54:13.000000000 +0200
-+++ /tmp/dpep.cbgbWp/idled/imap/idle_idled.c	2006-05-06 12:54:35.061908785 +0200
+diff -urNad idled/imap/idle_idled.c /tmp/dpep.JGdoug/idled/imap/idle_idled.c
+--- idled/imap/idle_idled.c	2006-05-06 14:51:16.000000000 +0200
++++ /tmp/dpep.JGdoug/idled/imap/idle_idled.c	2006-05-06 14:51:18.166885051 +0200
 @@ -58,8 +58,6 @@
  #include "idled.h"
  #include "global.h"
@@ -327,9 +327,9 @@
 +    &idle_start,
 +    &idle_done
 +};
-diff -urNad idled/imap/idle_no.c /tmp/dpep.cbgbWp/idled/imap/idle_no.c
---- idled/imap/idle_no.c	2006-04-23 22:37:08.000000000 +0200
-+++ /tmp/dpep.cbgbWp/idled/imap/idle_no.c	2006-05-06 12:54:35.061908785 +0200
+diff -urNad idled/imap/idle_no.c /tmp/dpep.JGdoug/idled/imap/idle_no.c
+--- idled/imap/idle_no.c	2006-05-06 14:51:15.000000000 +0200
++++ /tmp/dpep.JGdoug/idled/imap/idle_no.c	2006-05-06 14:51:18.166885051 +0200
 @@ -42,23 +42,31 @@
  
  #include "idle.h"
@@ -369,9 +369,9 @@
 +    &start,
 +    &done
 +};
-diff -urNad idled/imap/idle_poll.c /tmp/dpep.cbgbWp/idled/imap/idle_poll.c
---- idled/imap/idle_poll.c	2006-04-23 22:37:08.000000000 +0200
-+++ /tmp/dpep.cbgbWp/idled/imap/idle_poll.c	2006-05-06 12:54:35.061908785 +0200
+diff -urNad idled/imap/idle_poll.c /tmp/dpep.JGdoug/idled/imap/idle_poll.c
+--- idled/imap/idle_poll.c	2006-05-06 14:51:15.000000000 +0200
++++ /tmp/dpep.JGdoug/idled/imap/idle_poll.c	2006-05-06 14:51:18.166885051 +0200
 @@ -51,15 +51,13 @@
  #include "idle.h"
  #include "global.h"
@@ -427,9 +427,9 @@
 +    &idle_start,
 +    &idle_done
 +};
-diff -urNad idled/imap/imapd.c /tmp/dpep.cbgbWp/idled/imap/imapd.c
---- idled/imap/imapd.c	2006-05-06 12:54:13.000000000 +0200
-+++ /tmp/dpep.cbgbWp/idled/imap/imapd.c	2006-05-06 12:54:35.068908125 +0200
+diff -urNad idled/imap/imapd.c /tmp/dpep.JGdoug/idled/imap/imapd.c
+--- idled/imap/imapd.c	2006-05-06 14:51:16.000000000 +0200
++++ /tmp/dpep.JGdoug/idled/imap/imapd.c	2006-05-06 14:51:18.170884675 +0200
 @@ -94,6 +94,8 @@
  
  #include "pushstats.h"		/* SNMP interface */
@@ -491,9 +491,9 @@
  	prot_printf(imapd_out, " IDLE");
      }
  
-diff -urNad idled/imap/lmtpd.c /tmp/dpep.cbgbWp/idled/imap/lmtpd.c
---- idled/imap/lmtpd.c	2006-05-06 12:54:13.000000000 +0200
-+++ /tmp/dpep.cbgbWp/idled/imap/lmtpd.c	2006-05-06 12:54:35.069908031 +0200
+diff -urNad idled/imap/lmtpd.c /tmp/dpep.JGdoug/idled/imap/lmtpd.c
+--- idled/imap/lmtpd.c	2006-05-06 14:51:16.000000000 +0200
++++ /tmp/dpep.JGdoug/idled/imap/lmtpd.c	2006-05-06 14:51:18.170884675 +0200
 @@ -95,6 +95,8 @@
  static sieve_interp_t *sieve_interp = NULL;
  #endif
@@ -512,9 +512,9 @@
  
      /* Set namespace */
      if ((r = mboxname_init_namespace(&lmtpd_namespace, 0)) != 0) {
-diff -urNad idled/imap/pop3d.c /tmp/dpep.cbgbWp/idled/imap/pop3d.c
---- idled/imap/pop3d.c	2006-05-06 12:54:13.000000000 +0200
-+++ /tmp/dpep.cbgbWp/idled/imap/pop3d.c	2006-05-06 12:54:35.072907748 +0200
+diff -urNad idled/imap/pop3d.c /tmp/dpep.JGdoug/idled/imap/pop3d.c
+--- idled/imap/pop3d.c	2006-05-06 14:51:16.000000000 +0200
++++ /tmp/dpep.JGdoug/idled/imap/pop3d.c	2006-05-06 14:51:18.171884581 +0200
 @@ -89,6 +89,8 @@
  #define DES_DEFS
  #include <krb.h>
@@ -533,9 +533,9 @@
  
      /* Set namespace */
      if ((r = mboxname_init_namespace(&popd_namespace, 0)) != 0) {
-diff -urNad idled/imap/version.c /tmp/dpep.cbgbWp/idled/imap/version.c
---- idled/imap/version.c	2006-04-23 22:37:08.000000000 +0200
-+++ /tmp/dpep.cbgbWp/idled/imap/version.c	2006-05-06 12:54:35.073907653 +0200
+diff -urNad idled/imap/version.c /tmp/dpep.JGdoug/idled/imap/version.c
+--- idled/imap/version.c	2006-05-06 14:51:15.000000000 +0200
++++ /tmp/dpep.JGdoug/idled/imap/version.c	2006-05-06 14:51:18.172884487 +0200
 @@ -68,6 +68,8 @@
  #include "sieve_interface.h"
  #endif
@@ -557,9 +557,9 @@
  
      prot_printf(pout, " \"environment\" \"%s\"", env_buf);
  }
-diff -urNad idled/lib/imapoptions /tmp/dpep.cbgbWp/idled/lib/imapoptions
---- idled/lib/imapoptions	2006-05-06 12:54:13.000000000 +0200
-+++ /tmp/dpep.cbgbWp/idled/lib/imapoptions	2006-05-06 12:54:35.075907465 +0200
+diff -urNad idled/lib/imapoptions /tmp/dpep.JGdoug/idled/lib/imapoptions
+--- idled/lib/imapoptions	2006-05-06 14:51:16.000000000 +0200
++++ /tmp/dpep.JGdoug/idled/lib/imapoptions	2006-05-06 14:51:18.172884487 +0200
 @@ -248,6 +248,9 @@
  /* The password to use for authentication to the backend server hostname
     (where hostname is the short hostname of the server) - Cyrus Murder */

Modified: branches/idled/doc/changes.html
URL: https://mail.incase.de/viewcvs/branches/idled/doc/changes.html?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/doc/changes.html (original)
+++ branches/idled/doc/changes.html Sat May  6 14:53:33 2006
@@ -7,6 +7,12 @@
 <title>Changes to the Cyrus IMAP Server</title>
 </head>
 <body>
+
+<h1>Changes to the Cyrus IMAP Server since 2.2.13</h1> 
+<ul> 
+<li><tt>ctl_mboxlist</tt> now dumps/undumps the mailbox type flags,
+making it useful for remote mailboxes.</li>
+</ul>
 
 <h1>Changes to the Cyrus IMAP Server since 2.2.12</h1> 
 <ul> 

Modified: branches/idled/doc/faq.html
URL: https://mail.incase.de/viewcvs/branches/idled/doc/faq.html?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/doc/faq.html (original)
+++ branches/idled/doc/faq.html Sat May  6 14:53:33 2006
@@ -111,7 +111,7 @@
 </pre>
 
 <p>Make sure that <tt>saslauthd</tt> is running and that the cyrus
-user can access the unix domain socket (defaults to <tt>/var/run/mux</tt>).
+user can access the unix domain socket (defaults to <tt>/var/run/saslauthd/mux</tt>).
 
 </dd>
 

Modified: branches/idled/doc/install-virtdomains.html
URL: https://mail.incase.de/viewcvs/branches/idled/doc/install-virtdomains.html?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/doc/install-virtdomains.html (original)
+++ branches/idled/doc/install-virtdomains.html Sat May  6 14:53:33 2006
@@ -99,6 +99,10 @@
 to the <tt>defaultdomain</tt>.  See <a href=#admins>Administrators</a>
 below for further discussion.
 
+<p><b>Note:</b> Users in the <tt>defaultdomain</tt> must <i>not</i>
+log in using the <tt>user at domain</tt> cross-realm login syntax. The
+<tt>user at domain</tt> type specification only works for them in LMTP.
+
 <p>Here is a sample <tt>imapd.conf</tt> with a minimal set of configuration
 options.</p>
 

Modified: branches/idled/imap/Makefile.in
URL: https://mail.incase.de/viewcvs/branches/idled/imap/Makefile.in?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/Makefile.in (original)
+++ branches/idled/imap/Makefile.in Sat May  6 14:53:33 2006
@@ -72,7 +72,7 @@
 LIBS = $(IMAP_LIBS) $(IMAP_COM_ERR_LIBS)
 DEPLIBS = ../lib/libcyrus.a ../lib/libcyrus_min.a @DEPLIBS@
 
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ @WARNERROR@
 LDFLAGS = @LDFLAGS@ @COM_ERR_LDFLAGS@ 
 
 SHELL = /bin/sh

Modified: branches/idled/imap/backend.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/backend.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/backend.c (original)
+++ branches/idled/imap/backend.c Sat May  6 14:53:33 2006
@@ -271,7 +271,7 @@
     /* need to (re)establish connection to server or create one */
     int sock = -1;
     int r;
-    int err = 0;
+    int err = -1;
     struct addrinfo hints, *res0 = NULL, *res1 = NULL, *res;
     struct sockaddr_un sunsock;
     char buf[2048], *mechlist = NULL;
@@ -397,6 +397,7 @@
 	    syslog(LOG_ERR, "couldn't authenticate to backend server: %s",
 		   sasl_errstring(r, NULL, NULL));
 	    free(ret);
+	    shutdown(sock, SHUT_RDWR);
 	    close(sock);
 	    ret = NULL;
 	}

Modified: branches/idled/imap/ctl_mboxlist.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/ctl_mboxlist.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/ctl_mboxlist.c (original)
+++ branches/idled/imap/ctl_mboxlist.c Sat May  6 14:53:33 2006
@@ -187,7 +187,7 @@
     switch (d->op) {
     case DUMP:
 	if(!d->partition || !strcmp(d->partition, part)) {
-	    printf("%s\t%s\t%s\n", name, part, acl);
+	    printf("%s\t%d %s\t%s\n", name, mbtype, part, acl);
 	    if(d->purge) {
 		config_mboxlist_db->delete(mbdb, key, keylen, &(d->tid), 0);
 	    }
@@ -479,7 +479,7 @@
     int r = 0;
     char buf[16384];
     int line = 0;
-    char last_commit[MAX_MAILBOX_NAME];
+    char last_commit[MAX_MAILBOX_NAME+1];
     char *key=NULL, *data=NULL;
     int keylen, datalen;
     int untilCommit = PER_COMMIT;
@@ -490,7 +490,7 @@
     while (fgets(buf, sizeof(buf), stdin)) {
 	char *name, *partition, *acl;
 	char *p;
-	int tries = 0;
+	int mbtype = 0, tries = 0;
 	
 	line++;
 
@@ -501,6 +501,12 @@
 	    continue;
 	}
 	*p++ = '\0';
+	if (isdigit((int) *p)) {
+	    /* new style dump */
+	    mbtype = strtol(p, &p, 10);
+	    /* skip trailing space */
+	    if (*p == ' ') p++;
+	}
 	partition = p;
 	for (; *p && *p != '\t'; p++) ;
 	if (!*p) {
@@ -523,7 +529,7 @@
 	}
 
 	key = name; keylen = strlen(key);
-	data = mboxlist_makeentry(0, partition, acl); datalen = strlen(data);
+	data = mboxlist_makeentry(mbtype, partition, acl); datalen = strlen(data);
 	
 	tries = 0;
     retry:

Modified: branches/idled/imap/deliver.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/deliver.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/deliver.c (original)
+++ branches/idled/imap/deliver.c Sat May  6 14:53:33 2006
@@ -99,7 +99,7 @@
 static void usage()
 {
     fprintf(stderr, 
-	    "421-4.3.0 usage: deliver [-C <alt_config> ] [-m mailbox]"
+	    "421-4.3.0 usage: cyrdeliver [-C <alt_config> ] [-m mailbox]"
 	    " [-a auth] [-r return_path] [-l] [-D]\r\n");
     fprintf(stderr, "421 4.3.0 %s\n", CYRUS_VERSION);
     exit(EC_USAGE);

Modified: branches/idled/imap/fetchnews.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/fetchnews.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/fetchnews.c (original)
+++ branches/idled/imap/fetchnews.c Sat May  6 14:53:33 2006
@@ -60,6 +60,7 @@
 #include "cyrusdb.h"
 #include "exitcodes.h"
 #include "global.h"
+#include "gmtoff.h"
 #include "lock.h"
 #include "prot.h"
 #include "xmalloc.h"
@@ -388,6 +389,7 @@
 	       &ctime.tm_hour, &ctime.tm_min, &ctime.tm_sec);
 	ctime.tm_year -= 1900;
 	ctime.tm_mon--;
+	ctime.tm_isdst = -1;
 
 	/* read the previous timestamp */
 	if (!sfile[0]) {
@@ -417,6 +419,7 @@
 	/* ask for new articles */
 	if (stamp) stamp -= 180; /* adjust back 3 minutes */
 	ptime = gmtime(&stamp);
+	ptime->tm_isdst = -1;
 	strftime(buf, sizeof(buf), datefmt, ptime);
 	prot_printf(pout, "NEWNEWS %s %s GMT\r\n", wildmat, buf);
 	
@@ -433,7 +436,7 @@
 	   We can't change this, otherwise we'd be incompatible
 	   with an old localtime timestamp.
 	*/
-	stamp -= timezone;
+	stamp += gmtoff_of(&ctime, stamp);
     }
 
     if (!newnews) {

Modified: branches/idled/imap/fud.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/fud.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/fud.c (original)
+++ branches/idled/imap/fud.c Sat May  6 14:53:33 2006
@@ -119,9 +119,9 @@
 
         while(1) {
             /* For safety */
-            memset(username,'\0',MAXLOGNAME + MAXDOMNAME);	
-            memset(mbox,'\0',MAX_MAILBOX_NAME+1);
-            memset(buf, '\0', MAXLOGNAME + MAX_MAILBOX_NAME + 1);
+            memset(username,'\0', sizeof(username));	
+            memset(mbox,'\0', sizeof(mbox));
+            memset(buf, '\0', sizeof(buf));
 
 	    if (signals_poll() == SIGHUP) {
 		/* caught a SIGHUP, return */
@@ -158,6 +158,15 @@
     mboxlist_done();
     closelog();
     cyrus_done();
+
+    /* be nice to remote */
+    shutdown(0, SHUT_RD);
+    shutdown(1, SHUT_RD);
+    shutdown(2, SHUT_RD);
+    close(0);
+    close(1);
+    close(2);
+
     exit(code);
 }
 

Modified: branches/idled/imap/global.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/global.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/global.c (original)
+++ branches/idled/imap/global.c Sat May  6 14:53:33 2006
@@ -91,6 +91,9 @@
 struct cyrusdb_backend *config_tlscache_db;
 struct cyrusdb_backend *config_ptscache_db;
 
+/* syslog prefix tag */
+static char syslog_prefix[20];
+
 /* Called before a cyrus application starts (but after command line parameters
  * are read) */
 int cyrus_init(const char *alt_config, const char *ident, unsigned flags)
@@ -118,7 +121,9 @@
     
     /* xxx we lose here since we can't have the prefix until we load the
      * config file */
-    openlog(config_ident, LOG_PID, SYSLOG_FACILITY);
+    strncpy(syslog_prefix, "cyrus/", sizeof(syslog_prefix));
+    strncat(syslog_prefix, ident, sizeof(syslog_prefix) - 7);
+    openlog(syslog_prefix, LOG_PID, SYSLOG_FACILITY);
 
     /* Load configuration file.  This will set config_dir when it finds it */
     config_read(alt_config);
@@ -465,7 +470,7 @@
 {
     struct namespace namespace;
     char *acl;
-    char bufuser[MAX_MAILBOX_NAME], inboxname[MAX_MAILBOX_NAME];
+    char bufuser[MAX_MAILBOX_NAME+1], inboxname[MAX_MAILBOX_NAME+1];
     int r;
 
     /* Set namespace */

Modified: branches/idled/imap/idle_idled.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/idle_idled.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/idle_idled.c (original)
+++ branches/idled/imap/idle_idled.c Sat May  6 14:53:33 2006
@@ -110,11 +110,11 @@
     idle_remote.sun_family = AF_UNIX;
     idle_sock = config_getstring(IMAPOPT_IDLESOCKET);
     if (idle_sock) {	
-	strcpy(idle_remote.sun_path, idle_sock);
+	strlcpy(idle_remote.sun_path, idle_sock, sizeof(idle_remote.sun_path));
     }
     else {
-	strcpy(idle_remote.sun_path, config_dir);
-	strcat(idle_remote.sun_path, FNAME_IDLE_SOCK);
+	strlcpy(idle_remote.sun_path, config_dir, sizeof(idle_remote.sun_path));
+	strlcat(idle_remote.sun_path, FNAME_IDLE_SOCK, sizeof(idle_remote.sun_path));
     }
     idle_remote_len = sizeof(idle_remote.sun_family) +
 	strlen(idle_remote.sun_path) + 1;

Modified: branches/idled/imap/imapd.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/imapd.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/imapd.c (original)
+++ branches/idled/imap/imapd.c Sat May  6 14:53:33 2006
@@ -767,6 +767,10 @@
 #ifdef HAVE_SSL
     tls_shutdown_serverengine();
 #endif
+    /* shutdown socket nicely */
+    cyrus_close_sock(0);
+    cyrus_close_sock(1);
+    cyrus_close_sock(2);
 
     cyrus_done();
 
@@ -1785,6 +1789,9 @@
 
 	sleep(3);
 
+	/* Don't allow user probing */
+	if (r == SASL_NOUSER) r = SASL_BADAUTH;
+
 	if ((reply = sasl_errstring(r, NULL, NULL)) != NULL) {
 	    prot_printf(imapd_out, "%s NO Login failed: %s\r\n", tag, reply);
 	} else {
@@ -1898,8 +1905,6 @@
 	    break;
 	default: 
 	    /* failed authentication */
-	    errorstring = sasl_errstring(sasl_result, NULL, NULL);
-
 	    syslog(LOG_NOTICE, "badlogin: %s %s [%s]",
 		   imapd_clienthost, authtype, sasl_errdetail(imapd_saslconn));
 
@@ -1908,6 +1913,10 @@
 				VARIABLE_LISTEND);
 	    sleep(3);
 
+	    /* Don't allow user probing */
+	    if (sasl_result == SASL_NOUSER) sasl_result = SASL_BADAUTH;
+
+	    errorstring = sasl_errstring(sasl_result, NULL, NULL);
 	    if (errorstring) {
 		prot_printf(imapd_out, "%s NO %s\r\n", tag, errorstring);
 	    } else {
@@ -3116,8 +3125,8 @@
 
     if (usinguid) {
 	fetchitems |= FETCH_UID;
-	index_check(imapd_mailbox, 1, 0);
-    }
+    }
+    index_check(imapd_mailbox, 1, 0);
 
     fetchargs.fetchitems = fetchitems;
     r = index_fetch(imapd_mailbox, sequence, usinguid, &fetchargs,
@@ -3132,6 +3141,9 @@
     } else if (fetchedsomething || usinguid) {
 	prot_printf(imapd_out, "%s OK %s (%s sec)\r\n", tag,
 		    error_message(IMAP_OK_COMPLETED), mytime);
+	if(fetchargs.fetchitems & FETCH_SETSEEN) {
+	    index_check(imapd_mailbox,usinguid,1);
+	}
     } else {
 	/* normal FETCH, nothing came back */
 	prot_printf(imapd_out, "%s NO %s (%s sec)\r\n", tag,
@@ -3250,7 +3262,8 @@
 
     index_fetch(imapd_mailbox, msgno, 0, &fetchargs, &fetchedsomething);
 
-    index_check(imapd_mailbox, 0, 0);
+    index_check(imapd_mailbox, 0,
+       fetchedsomething && (fetchargs.fetchitems & FETCH_SETSEEN));
 
     if (fetchedsomething) {
 	prot_printf(imapd_out, "%s OK %s\r\n", tag,
@@ -3382,7 +3395,9 @@
     r = index_store(imapd_mailbox, sequence, usinguid, &storeargs,
 		    flag, nflags);
 
-    if (usinguid) {
+    if(storeargs.seen || storeargs.operation==STORE_REPLACE) {
+	index_check(imapd_mailbox, usinguid, 1);
+    } else if (usinguid) {
 	index_check(imapd_mailbox, 1, 0);
     }
 
@@ -6091,8 +6106,8 @@
     memset(&tmp, 0, sizeof(struct buf));
     memset(&user, 0, sizeof(struct buf));
 
-    prot_printf(pout, "ACL0 GETACL {%d+}\r\n%s\r\n",
-		strlen(mailbox), mailbox);
+    prot_printf(pout, "ACL0 GETACL {%lu+}\r\n%s\r\n",
+		(unsigned long) strlen(mailbox), mailbox);
 
     while(1) {
 	c = getword(pin, &tag);
@@ -6142,9 +6157,9 @@
 
 		snprintf(tagbuf, sizeof(tagbuf), "ACL%d", ++i);
 		
-		prot_printf(pout, "%s DELETEACL {%d+}\r\n%s {%d+}\r\n%s\r\n",
-			    tagbuf, strlen(mailbox), mailbox,
-			    strlen(user.s), user.s);
+		prot_printf(pout, "%s DELETEACL {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
+			    tagbuf, (unsigned long) strlen(mailbox), mailbox,
+			    (unsigned long) strlen(user.s), user.s);
 		if(c == '\r') {
 		    c = prot_getc(pin);
 		    if(c != '\n') {
@@ -6219,11 +6234,11 @@
 
 	snprintf(tag, sizeof(tag), "SACL%d", tagnum++);
 	
-	prot_printf(pout, "%s SETACL {%d+}\r\n%s {%d+}\r\n%s {%d+}\r\n%s\r\n",
+	prot_printf(pout, "%s SETACL {%d+}\r\n%s {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
 		    tag,
 		    mailboxlen, mailbox,
-		    strlen(acl), acl,
-		    strlen(rights), rights);
+		    (unsigned long) strlen(acl), acl,
+		    (unsigned long) strlen(rights), rights);
 
 	while(1) {
 	    c = getword(pin, &inbuf);
@@ -6337,11 +6352,11 @@
     if(!r) {
 	if(topart) {
 	    /* need to send partition as an atom */
-	    prot_printf(be->out, "LC1 LOCALCREATE {%d+}\r\n%s %s\r\n",
-			strlen(name), name, topart);
+	    prot_printf(be->out, "LC1 LOCALCREATE {%lu+}\r\n%s %s\r\n",
+			(unsigned long) strlen(name), name, topart);
 	} else {
-	    prot_printf(be->out, "LC1 LOCALCREATE {%d+}\r\n%s\r\n",
-			strlen(name), name);
+	    prot_printf(be->out, "LC1 LOCALCREATE {%lu+}\r\n%s\r\n",
+			(unsigned long) strlen(name), name);
 	}
 	r = getresult(be->in, "LC1");
 	if(r) syslog(LOG_ERR, "Could not move mailbox: %s, LOCALCREATE failed",
@@ -6375,7 +6390,8 @@
     if(!r) {
 	backout_mupdate = 1;
 
-	prot_printf(be->out, "D01 UNDUMP {%d+}\r\n%s ", strlen(name), name);
+	prot_printf(be->out, "D01 UNDUMP {%lu+}\r\n%s ",
+		    (unsigned long) strlen(name), name);
 
 	r = dump_mailbox(NULL, mailboxname, path, acl, 0, be->in, be->out,
 			 imapd_authstate);
@@ -6421,8 +6437,8 @@
 	/* 6.5) Kick remote server to correct mupdate entry */
 	/* Note that we don't really care if this succeeds or not */
 	if (mupdate_h) {
-	    prot_printf(be->out, "MP1 MUPDATEPUSH {%d+}\r\n%s\r\n",
-			strlen(name), name);
+	    prot_printf(be->out, "MP1 MUPDATEPUSH {%lu+}\r\n%s\r\n",
+			(unsigned long) strlen(name), name);
 	    rerr = getresult(be->in, "MP1");
 	    if(rerr) {
 		syslog(LOG_ERR,
@@ -6461,8 +6477,8 @@
     }
     if(r && backout_remotebox) {
 	rerr = 0;
-	prot_printf(be->out, "LD1 LOCALDELETE {%d+}\r\n%s\r\n",
-		    strlen(name), name);
+	prot_printf(be->out, "LD1 LOCALDELETE {%lu+}\r\n%s\r\n",
+		    (unsigned long) strlen(name), name);
 	rerr = getresult(be->in, "LD1");
  	if(rerr) {
 	    syslog(LOG_ERR,
@@ -6657,9 +6673,10 @@
 	    if(!r) {
 		/* note use of + to force the setting of a nonexistant
 		 * quotaroot */
-		prot_printf(be->out, "Q01 SETQUOTA {%d+}\r\n" \
+		prot_printf(be->out, "Q01 SETQUOTA {%lu+}\r\n" \
 			    "+%s (STORAGE %d)\r\n",
-			    strlen(name)+1, name, quota.limit);
+			    (unsigned long) strlen(name)+1,
+			    name, quota.limit);
 		r = getresult(be->in, "Q01");
 		if(r) syslog(LOG_ERR,
 			     "Could not move mailbox: %s, " \
@@ -7203,7 +7220,7 @@
 
     /* if it's too long, literal it */
     if (*p || len >= 1024) {
-	prot_printf(imapd_out, "{%u}\r\n%s", strlen(s), s);
+	prot_printf(imapd_out, "{%lu}\r\n%s", (unsigned long) strlen(s), s);
     } else {
 	prot_printf(imapd_out, "\"%s\"", s);
     }
@@ -7233,7 +7250,7 @@
 
     /* if it's too long, literal it */
     if (*p || len >= 1024) {
-	prot_printf(imapd_out, "{%u}\r\n%s", strlen(s), s);
+	prot_printf(imapd_out, "{%lu}\r\n%s", (unsigned long) strlen(s), s);
     } else {
 	prot_printf(imapd_out, "\"%s\"", s);
     }

Modified: branches/idled/imap/index.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/index.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/index.c (original)
+++ branches/idled/imap/index.c Sat May  6 14:53:33 2006
@@ -3291,9 +3291,17 @@
 		cur->from = get_localpart_addr(from + CACHE_ITEM_SIZE_SKIP);
 		break;
 	    case SORT_SUBJECT:
-		cur->xsubj = index_extract_subject(subj + CACHE_ITEM_SIZE_SKIP,
-						   CACHE_ITEM_LEN(subj),
-						   &cur->is_refwd);
+		 {
+		     int len = CACHE_ITEM_LEN(subj);
+		     char *t = xmalloc(len+1);
+		
+		     memcpy(t, subj + CACHE_ITEM_SIZE_SKIP, len);
+		     t[len] = '\0';
+		
+		     cur->xsubj = index_extract_subject(t, len, &cur->is_refwd);
+		
+		     free(t);
+		 }
 		cur->xsubj_hash = strhash(cur->xsubj);
 		break;
 	    case SORT_TO:

Modified: branches/idled/imap/lmtpd.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/lmtpd.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/lmtpd.c (original)
+++ branches/idled/imap/lmtpd.c Sat May  6 14:53:33 2006
@@ -552,6 +552,9 @@
 
     cyrus_done();
 
+    /* shutdown socket nicely */
+    cyrus_reset_stdio();
+
     exit(code);
 }
 

Modified: branches/idled/imap/mbdump.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/mbdump.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/mbdump.c (original)
+++ branches/idled/imap/mbdump.c Sat May  6 14:53:33 2006
@@ -271,8 +271,8 @@
 
 	/* send filename, size, and contents */
 	if(first) {
-	    prot_printf(pout, "{%d}\r\n",
-			strlen(name));
+	    prot_printf(pout, "{%lu}\r\n",
+			(unsigned long) strlen(name));
 
 	    if(!tag) {
 		/* synchronize */
@@ -292,8 +292,8 @@
 
 	    first = 0;
 	} else {
-	    prot_printf(pout, " {%d%s}\r\n%s {%lu%s}\r\n",
-			strlen(name),
+	    prot_printf(pout, " {%lu%s}\r\n%s {%lu%s}\r\n",
+			(unsigned long) strlen(name),
 			(!tag ? "+" : ""),
 			name, len,
 			(!tag ? "+" : ""));
@@ -327,8 +327,8 @@
 
 	/* send filename, size, and contents */
 	if(first) {
-	    prot_printf(pout, "{%d}\r\n",
-			strlen(data_files[i]));
+	    prot_printf(pout, "{%lu}\r\n",
+			(unsigned long) strlen(data_files[i]));
 	    
 	    if(!tag) {
 		/* synchronize */
@@ -347,8 +347,8 @@
 			(!tag ? "+" : ""));
 	    first = 0;
 	} else {
-	    prot_printf(pout, " {%d%s}\r\n%s {%lu%s}\r\n",
-			strlen(data_files[i]),
+	    prot_printf(pout, " {%lu%s}\r\n%s {%lu%s}\r\n",
+			(unsigned long) strlen(data_files[i]),
 			(!tag ? "+" : ""),
 			data_files[i], len,
 			(!tag ? "+" : ""));
@@ -474,8 +474,8 @@
 				snprintf(ext_fname, sizeof(ext_fname),
 					 "SIEVE-%s", next->d_name);
 			    }
-			    prot_printf(pout, " {%d%s}\r\n%s {%lu%s}\r\n",
-					strlen(ext_fname), 
+			    prot_printf(pout, " {%lu%s}\r\n%s {%lu%s}\r\n",
+					(unsigned long) strlen(ext_fname), 
 					(!tag ? "+" : ""),
 					ext_fname,
 					len,

Modified: branches/idled/imap/mboxlist.h
URL: https://mail.incase.de/viewcvs/branches/idled/imap/mboxlist.h?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/mboxlist.h (original)
+++ branches/idled/imap/mboxlist.h Sat May  6 14:53:33 2006
@@ -73,7 +73,7 @@
 
 /* each mailbox has the following data */
 struct mbox_entry {
-    char name[MAX_MAILBOX_NAME];
+    char name[MAX_MAILBOX_NAME+1];
     int mbtype;
     char partition[MAX_PARTITION_LEN];
 				/* holds remote machine for REMOTE mailboxes */

Modified: branches/idled/imap/message.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/message.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/message.c (original)
+++ branches/idled/imap/message.c Sat May  6 14:53:33 2006
@@ -227,6 +227,7 @@
     int n;
     int sawcr = 0, sawnl;
     int reject8bit = config_getswitch(IMAPOPT_REJECT8BIT);
+    int munge8bit = config_getswitch(IMAPOPT_MUNGE8BIT);
     int inheader = 1, blankline = 1;
 
     while (size) {
@@ -262,7 +263,7 @@
 			/* We have been configured to reject all mail of this
 			   form. */
 			if (!r) r = IMAP_MESSAGE_CONTAINS8BIT;
-		    } else {
+		    } else if (munge8bit) {
 			/* We have been configured to munge all mail of this
 			   form. */
 			*p = 'X';
@@ -795,7 +796,7 @@
     /* Save header value */
     len = hdrend - hdr;
     message_ibuf_ensure(ibuf, len+2);
-    strncpy(ibuf->end, hdr, len);
+    strncpy(ibuf->end, hdr, len+1);
     ibuf->end += len;
     *(ibuf->end)++ = '\r';
     *(ibuf->end)++ = '\n';
@@ -2059,7 +2060,7 @@
     if (*p || len >= 1024) {
 	/* Write out as literal */
 	char buf[100];
-	snprintf(buf, sizeof(buf), "{%u}\r\n", strlen(s));
+	snprintf(buf, sizeof(buf), "{%lu}\r\n", (unsigned long) strlen(s));
 	message_ibuf_ensure(ibuf, strlen(s)+strlen(buf));
 	for (p = buf; *p; p++) *(ibuf->end)++ = *p;
 	for (p = s; *p; p++) *(ibuf->end)++ = *p;

Modified: branches/idled/imap/mupdate-client.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/mupdate-client.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/mupdate-client.c (original)
+++ branches/idled/imap/mupdate-client.c Sat May  6 14:53:33 2006
@@ -330,9 +330,11 @@
     if (!handle->saslcompleted) return MUPDATE_NOAUTH;
 
     prot_printf(handle->pout,
-		"X%u ACTIVATE {%d+}\r\n%s {%d+}\r\n%s {%d+}\r\n%s\r\n", 
-		handle->tagn++, strlen(mailbox), mailbox, 
-		strlen(server), server, strlen(acl), acl);
+		"X%u ACTIVATE {%lu+}\r\n%s {%lu+}\r\n%s {%lu+}\r\n%s\r\n", 
+		handle->tagn++,
+		(unsigned long) strlen(mailbox), mailbox,
+		(unsigned long) strlen(server), server,
+		(unsigned long) strlen(acl), acl);
 
     ret = mupdate_scarf(handle, mupdate_scarf_one, NULL, 1, &response);
     if (ret) {
@@ -355,9 +357,10 @@
     if (!handle->saslcompleted) return MUPDATE_NOAUTH;
 
     prot_printf(handle->pout,
-		"X%u RESERVE {%d+}\r\n%s {%d+}\r\n%s\r\n",
-		handle->tagn++, strlen(mailbox), mailbox, 
-		strlen(server), server);
+		"X%u RESERVE {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
+		handle->tagn++,
+		(unsigned long) strlen(mailbox), mailbox, 
+		(unsigned long) strlen(server), server);
 
     ret = mupdate_scarf(handle, mupdate_scarf_one, NULL, 1, &response);
     if (ret) {
@@ -380,9 +383,10 @@
     if (!handle->saslcompleted) return MUPDATE_NOAUTH;
 
     prot_printf(handle->pout,
-		"X%u DEACTIVATE {%d+}\r\n%s {%d+}\r\n%s\r\n",
-		handle->tagn++, strlen(mailbox), mailbox, 
-		strlen(server), server);
+		"X%u DEACTIVATE {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
+		handle->tagn++,
+		(unsigned long) strlen(mailbox), mailbox, 
+		(unsigned long) strlen(server), server);
 
     ret = mupdate_scarf(handle, mupdate_scarf_one, NULL, 1, &response);
     if (ret) {
@@ -405,8 +409,8 @@
     if (!handle->saslcompleted) return MUPDATE_NOAUTH;
 
     prot_printf(handle->pout,
-		"X%u DELETE {%d+}\r\n%s\r\n", handle->tagn++, 
-		strlen(mailbox), mailbox);
+		"X%u DELETE {%lu+}\r\n%s\r\n", handle->tagn++, 
+		(unsigned long) strlen(mailbox), mailbox);
 
     ret = mupdate_scarf(handle, mupdate_scarf_one, NULL, 1, &response);
     if (ret) {
@@ -474,8 +478,8 @@
     if(!handle || !mailbox || !target) return MUPDATE_BADPARAM;
 
     prot_printf(handle->pout,
-		"X%u FIND {%d+}\r\n%s\r\n", handle->tagn++, 
-		strlen(mailbox), mailbox);
+		"X%u FIND {%lu+}\r\n%s\r\n", handle->tagn++, 
+		(unsigned long) strlen(mailbox), mailbox);
 
     memset(&(handle->mailboxdata_buf), 0, sizeof(handle->mailboxdata_buf));
 
@@ -507,8 +511,8 @@
 
     if(prefix) {
 	prot_printf(handle->pout,
-		    "X%u LIST {%d+}\r\n%s\r\n", handle->tagn++,
-		    strlen(prefix), prefix);
+		    "X%u LIST {%lu+}\r\n%s\r\n", handle->tagn++,
+		    (unsigned long) strlen(prefix), prefix);
     } else {
 	prot_printf(handle->pout,
 		    "X%u LIST\r\n", handle->tagn++);

Modified: branches/idled/imap/mupdate.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/mupdate.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/mupdate.c (original)
+++ branches/idled/imap/mupdate.c Sat May  6 14:53:33 2006
@@ -1613,20 +1613,20 @@
     pthread_mutex_unlock(&mailboxes_mutex); /* UNLOCK */
 
     if (m && m->t == SET_ACTIVE) {
-	prot_printf(C->pout, "%s MAILBOX {%d+}\r\n%s {%d+}\r\n%s {%d+}\r\n%s\r\n",
+	prot_printf(C->pout, "%s MAILBOX {%lu+}\r\n%s {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
 		    tag,
-		    strlen(m->mailbox), m->mailbox,
-		    strlen(m->server), m->server,
-		    strlen(m->acl), m->acl);
+		    (unsigned long) strlen(m->mailbox), m->mailbox,
+		    (unsigned long) strlen(m->server), m->server,
+		    (unsigned long) strlen(m->acl), m->acl);
     } else if (m && m->t == SET_RESERVE) {
-	prot_printf(C->pout, "%s RESERVE {%d+}\r\n%s {%d+}\r\n%s\r\n",
+	prot_printf(C->pout, "%s RESERVE {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
 		    tag,
-		    strlen(m->mailbox), m->mailbox,
-		    strlen(m->server), m->server);
+		    (unsigned long) strlen(m->mailbox), m->mailbox,
+		    (unsigned long) strlen(m->server), m->server);
     } else if (send_delete) {
 	/* not found, if needed, send a delete */
-	prot_printf(C->pout, "%s DELETE {%d+}\r\n%s\r\n",
-		    tag, strlen(mailbox), mailbox);
+	prot_printf(C->pout, "%s DELETE {%lu+}\r\n%s\r\n",
+		    tag, (unsigned long) strlen(mailbox), mailbox);
     }
     
     free_mbent(m);
@@ -1668,17 +1668,17 @@
 	    switch (m->t) {
 	    case SET_ACTIVE:
 		prot_printf(C->pout,
-			    "%s MAILBOX {%d+}\r\n%s {%d+}\r\n%s {%d+}\r\n%s\r\n",
+			    "%s MAILBOX {%lu+}\r\n%s {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
 			    C->streaming,
-			    strlen(m->mailbox), m->mailbox,
-			    strlen(m->server), m->server,
-			    strlen(m->acl), m->acl);
+			    (unsigned long) strlen(m->mailbox), m->mailbox,
+			    (unsigned long) strlen(m->server), m->server,
+			    (unsigned long) strlen(m->acl), m->acl);
 		break;
 	    case SET_RESERVE:
-		prot_printf(C->pout, "%s RESERVE {%d+}\r\n%s {%d+}\r\n%s\r\n",
+		prot_printf(C->pout, "%s RESERVE {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
 			    C->streaming,
-			    strlen(m->mailbox), m->mailbox,
-			    strlen(m->server), m->server);
+			    (unsigned long) strlen(m->mailbox), m->mailbox,
+			    (unsigned long) strlen(m->server), m->server);
 		break;
 		
 	    case SET_DELETE:

Modified: branches/idled/imap/mupdate.h
URL: https://mail.incase.de/viewcvs/branches/idled/imap/mupdate.h?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/mupdate.h (original)
+++ branches/idled/imap/mupdate.h Sat May  6 14:53:33 2006
@@ -70,8 +70,8 @@
     struct buf tag, cmd, arg1, arg2, arg3;
 
     /* For client side mupdate_find calls */
-    char mailbox_buf[MAX_MAILBOX_NAME];
-    char server_buf[MAX_MAILBOX_NAME];
+    char mailbox_buf[MAX_MAILBOX_NAME+1];
+    char server_buf[MAX_MAILBOX_NAME+1];
     char *acl_buf;
     size_t acl_buf_len;
     struct mupdate_mailboxdata mailboxdata_buf;

Modified: branches/idled/imap/nntpd.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/nntpd.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/nntpd.c (original)
+++ branches/idled/imap/nntpd.c Sat May  6 14:53:33 2006
@@ -2140,13 +2140,16 @@
 	    default:
 		code = 481;
 	    }
-	    errorstring = sasl_errstring(sasl_result, NULL, NULL);
 
 	    syslog(LOG_NOTICE, "badlogin: %s %s [%s]",
 		   nntp_clienthost, mech, sasl_errdetail(nntp_saslconn));
 
 	    sleep(3);
 
+	    /* Don't allow user probing */
+	    if (sasl_result == SASL_NOUSER) sasl_result = SASL_BADAUTH;
+
+	    errorstring = sasl_errstring(sasl_result, NULL, NULL);
 	    if (errorstring) {
 		prot_printf(nntp_out, "%d %s\r\n", code, errorstring);
 	    } else {

Modified: branches/idled/imap/pop3d.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/pop3d.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/pop3d.c (original)
+++ branches/idled/imap/pop3d.c Sat May  6 14:53:33 2006
@@ -496,6 +496,9 @@
 #endif
 
     cyrus_done();
+    cyrus_close_sock(0);
+    cyrus_close_sock(1);
+    cyrus_close_sock(2);
 
     exit(code);
 }
@@ -519,41 +522,6 @@
 }
 
 #ifdef HAVE_KRB
-/* translate IPv4 mapped IPv6 address to IPv4 address */
-#ifdef IN6_IS_ADDR_V4MAPPED
-static void sockaddr_unmapped(struct sockaddr *sa, socklen_t *len)
-{
-    struct sockaddr_in6 *sin6;
-    struct sockaddr_in *sin4;
-    uint32_t addr;
-    int port;
-
-    if (sa->sa_family != AF_INET6)
-	return;
-    sin6 = (struct sockaddr_in6 *)sa;
-    if (!IN6_IS_ADDR_V4MAPPED((&sin6->sin6_addr)))
-	return;
-    sin4 = (struct sockaddr_in *)sa;
-    addr = *(uint32_t *)&sin6->sin6_addr.s6_addr[12];
-    port = sin6->sin6_port;
-    memset(sin4, 0, sizeof(struct sockaddr_in));
-    sin4->sin_addr.s_addr = addr;
-    sin4->sin_port = port;
-    sin4->sin_family = AF_INET;
-#ifdef HAVE_SOCKADDR_SA_LEN
-    sin4->sin_len = sizeof(struct sockaddr_in);
-#endif
-    *len = sizeof(struct sockaddr_in);
-}
-#else
-static void sockaddr_unmapped(struct sockaddr *sa __attribute__((unused)),
-			      socklen_t *len __attribute__((unused)))
-{
-    return;
-}
-#endif
-
-
 /*
  * MIT's kludge of a kpop protocol
  * Client does a krb_sendauth() first thing
@@ -1027,15 +995,18 @@
     /* failed authentication */
     if (sasl_result != SASL_OK)
     {
-	sleep(3);      
-		
-	prot_printf(popd_out, "-ERR [AUTH] authenticating: %s\r\n",
-		    sasl_errstring(sasl_result, NULL, NULL));
-
 	syslog(LOG_NOTICE, "badlogin: %s APOP (%s) %s",
 	       popd_clienthost, popd_apop_chal,
 	       sasl_errdetail(popd_saslconn));
 	
+	sleep(3);      
+		
+	/* Don't allow user probing */
+	if (sasl_result == SASL_NOUSER) sasl_result = SASL_BADAUTH;
+		
+	prot_printf(popd_out, "-ERR [AUTH] authenticating: %s\r\n",
+		    sasl_errstring(sasl_result, NULL, NULL));
+
 	return;
     }
 
@@ -1292,11 +1263,6 @@
 	    break;
 	default:
 	    /* failed authentication */
-	    sleep(3);
-		
-	    prot_printf(popd_out, "-ERR [AUTH] authenticating: %s\r\n",
-			sasl_errstring(sasl_result, NULL, NULL));
-
 	    if (authtype) {
 		syslog(LOG_NOTICE, "badlogin: %s %s %s",
 		       popd_clienthost, authtype,
@@ -1305,6 +1271,14 @@
 		syslog(LOG_NOTICE, "badlogin: %s %s",
 		       popd_clienthost, authtype);
 	    }
+
+	    sleep(3);
+		
+	    /* Don't allow user probing */
+	    if (sasl_result == SASL_NOUSER) sasl_result = SASL_BADAUTH;
+		
+	    prot_printf(popd_out, "-ERR [AUTH] authenticating: %s\r\n",
+			sasl_errstring(sasl_result, NULL, NULL));
 	}
 	
 	reset_saslconn(&popd_saslconn);

Modified: branches/idled/imap/proxyd.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/proxyd.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/proxyd.c (original)
+++ branches/idled/imap/proxyd.c Sat May  6 14:53:33 2006
@@ -1213,7 +1213,7 @@
 		 char **envp __attribute__((unused)))
 {
     socklen_t salen;
-    char hbuf[NI_MAXHOST];
+    char hbuf[NI_MAXHOST+1];
     struct sockaddr_storage proxyd_localaddr, proxyd_remoteaddr;
     char localip[60], remoteip[60];
     int niflags;
@@ -1382,6 +1382,9 @@
 #endif
 
     cyrus_done();
+    cyrus_close_sock(0);
+    cyrus_close_sock(1);
+    cyrus_close_sock(2);
 
     exit(code);
 }
@@ -2106,7 +2109,7 @@
     char c;
     struct buf passwdbuf;
     char *passwd;
-    char *reply = 0;
+    const char *reply = 0;
     int r;
 
     if (proxyd_userid) {
@@ -2180,17 +2183,19 @@
 				 strlen(canon_user),
 				 passwd,
 				 strlen(passwd)))!=SASL_OK) {
-	const char *errorstring = sasl_errstring(r, NULL, NULL);
-	if (reply) {
-	    syslog(LOG_NOTICE, "badlogin: %s plaintext %s %s",
-		   proxyd_clienthost, canon_user, reply);
-	}
+	syslog(LOG_NOTICE, "badlogin: %s plaintext %s %s",
+	       proxyd_clienthost, canon_user, sasl_errdetail(proxyd_saslconn));
+
 	/* Apply penalty only if not under layer */
 	if (proxyd_starttls_done == 0)
 	    sleep(3);
-	if (errorstring) {
+
+	/* Don't allow user probing */
+	if (r == SASL_NOUSER) r = SASL_BADAUTH;
+
+	if ((reply = sasl_errstring(r, NULL, NULL)) != NULL) {
 	    prot_printf(proxyd_out, "%s NO Login failed: %s\r\n", 
-			tag, errorstring);
+			tag, reply);
 	} else {
 	    prot_printf(proxyd_out, "%s NO Login failed.", tag);
 	}
@@ -2276,8 +2281,6 @@
 	    break;
 	default: 
 	    /* failed authentication */
-	    errorstring = sasl_errstring(sasl_result, NULL, NULL);
-
 	    syslog(LOG_NOTICE, "badlogin: %s %s [%s]",
 		   proxyd_clienthost, authtype, sasl_errdetail(proxyd_saslconn));
 
@@ -2286,6 +2289,10 @@
 				VARIABLE_LISTEND);
 	    sleep(3);
 
+	    /* Don't allow user probing */
+	    if (sasl_result == SASL_NOUSER) sasl_result = SASL_BADAUTH;
+
+	    errorstring = sasl_errstring(sasl_result, NULL, NULL);
 	    if (errorstring) {
 		prot_printf(proxyd_out, "%s NO %s\r\n", tag, errorstring);
 	    } else {
@@ -2834,7 +2841,8 @@
     if (!r) {
 	int is_active = 1;
 	s->context = (void*) &is_active;
-	prot_printf(s->out, "%s Append {%d+}\r\n%s ", tag, strlen(name), name);
+ 	prot_printf(s->out, "%s Append {%lu+}\r\n%s ", tag,
+ 			(unsigned long) strlen(name), name);
 	if (!(r = pipe_command(s, 16384))) {
 	    pipe_until_tag(s, tag, 0);
 	}
@@ -2910,8 +2918,8 @@
 	return;
     }
 
-    prot_printf(backend_current->out, "%s %s {%d+}\r\n%s\r\n", tag, cmd, 
-		strlen(name), name);
+    prot_printf(backend_current->out, "%s %s {%lu+}\r\n%s\r\n", tag, cmd, 
+		(unsigned long) strlen(name), name);
     switch (pipe_including_tag(backend_current, tag, 0)) {
     case PROXY_OK:
 	proc_register("proxyd", proxyd_clienthost, proxyd_userid, mailboxname);
@@ -3141,8 +3149,9 @@
 		    r == 0 ? "[TRYCREATE] " : "", error_message(r));
     } else if (s == backend_current) {
 	/* this is the easy case */
-	prot_printf(backend_current->out, "%s %s %s {%d+}\r\n%s\r\n",
-		    tag, cmd, sequence, strlen(name), name);
+	prot_printf(backend_current->out, "%s %s %s {%lu+}\r\n%s\r\n",
+		    tag, cmd, sequence, 
+		    (unsigned long) strlen(name), name);
 	pipe_including_tag(backend_current, tag, 0);
     } else {
 	char mytag[128];
@@ -3303,7 +3312,8 @@
 	}
 
 	/* start the append */
-	prot_printf(s->out, "%s Append {%d+}\r\n%s", tag, strlen(name), name);
+	prot_printf(s->out, "%s Append {%lu+}\r\n%s", tag,
+			(unsigned long) strlen(name), name);
 	prot_printf(backend_current->out, "%s %s %s (Rfc822.peek)\r\n",
 		    mytag, usinguid ? "Uid Fetch" : "Fetch", sequence);
 	for (/* each FETCH response */;;) {
@@ -3548,8 +3558,8 @@
 
     if (!r) {
 	/* ok, send the create to that server */
-	prot_printf(s->out, "%s CREATE {%d+}\r\n%s\r\n", 
-		    tag, strlen(name), name);
+	prot_printf(s->out, "%s CREATE {%lu+}\r\n%s\r\n", 
+		    tag, (unsigned long) strlen(name), name);
 	res = pipe_including_tag(s, tag, 0);
 	tag = "*";		/* can't send another tagged response */
 	
@@ -3589,8 +3599,8 @@
     }
 
     if (!r) {
-	prot_printf(s->out, "%s DELETE {%d+}\r\n%s\r\n", 
-		    tag, strlen(name), name);
+	prot_printf(s->out, "%s DELETE {%lu+}\r\n%s\r\n", 
+		    tag, (unsigned long) strlen(name), name);
 	res = pipe_including_tag(s, tag, 0);
 	tag = "*";		/* can't send another tagged response */
 
@@ -3691,17 +3701,17 @@
 		/* Cross Server */
 		/* <tag> XFER <name> <dest server> <dest partition> */
 		prot_printf(s->out,
-			    "%s XFER {%d+}\r\n%s {%d+}\r\n%s {%d+}\r\n%s\r\n", 
-			    tag, strlen(oldname), oldname,
-			    strlen(newserver), newserver,
-			    strlen(destpart), destpart);
+			    "%s XFER {%lu+}\r\n%s {%lu+}\r\n%s {%lu+}\r\n%s\r\n", 
+			    tag, (unsigned long) strlen(oldname), oldname,
+			    (unsigned long) strlen(newserver), newserver,
+			    (unsigned long) strlen(destpart), destpart);
 	    }
 	    
 	} else {
 	    /* <tag> XFER <name> <dest server> */
-	    prot_printf(s->out, "%s XFER {%d+}\r\n%s {%d+}\r\n%s\r\n", 
-			tag, strlen(oldname), oldname,
-			strlen(partition), partition);
+	    prot_printf(s->out, "%s XFER {%lu+}\r\n%s {%lu+}\r\n%s\r\n", 
+			tag, (unsigned long) strlen(oldname), oldname,
+			(unsigned long) strlen(partition), partition);
 	}
 	
 	res = pipe_including_tag(s, tag, 0);
@@ -3717,9 +3727,9 @@
 	    /* do MUPDATE create operations for new mailbox */
 	}
 
-	prot_printf(s->out, "%s RENAME {%d+}\r\n%s {%d+}\r\n%s\r\n", 
-		    tag, strlen(oldname), oldname,
-		    strlen(newname), newname);
+	prot_printf(s->out, "%s RENAME {%lu+}\r\n%s {%lu+}\r\n%s\r\n", 
+		    tag, (unsigned long) strlen(oldname), oldname,
+		    (unsigned long) strlen(newname), newname);
 	res = pipe_including_tag(s, tag, 0);
 	tag = "*";		/* can't send another tagged response */
 	
@@ -3754,8 +3764,8 @@
 
 	if (backend_inbox) {
 	    prot_printf(backend_inbox->out, 
-			"%s Lsub \"\" {%d+}\r\n%s\r\n",
-			tag, strlen(pattern), pattern);
+			"%s Lsub \"\" {%lu+}\r\n%s\r\n",
+			tag, (unsigned long) strlen(pattern), pattern);
 	    pipe_lsub(backend_inbox, tag, 0, "MAILBOX");
 	} else {		/* user doesn't have an INBOX */
 	    /* noop */
@@ -3824,9 +3834,9 @@
 
 	if (backend_inbox) {
 	    prot_printf(backend_inbox->out, 
-			"%s Lsub {%d+}\r\n%s {%d+}\r\n%s\r\n",
-			tag, strlen(reference), reference,
-			strlen(pattern), pattern);
+			"%s Lsub {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
+			tag, (unsigned long) strlen(reference), reference,
+			(unsigned long) strlen(pattern), pattern);
 	    pipe_lsub(backend_inbox, tag, 0, (listopts & LIST_LSUB) ? "LSUB" : "LIST");
 	} else {		/* user doesn't have an INBOX */
 	    /* noop */
@@ -3915,14 +3925,14 @@
 	
 	if (namespace) {
 	    prot_printf(backend_inbox->out, 
-			"%s %s {%d+}\r\n%s {%d+}\r\n%s\r\n", 
+			"%s %s {%lu+}\r\n%s {%lu+}\r\n%s\r\n", 
 			tag, cmd, 
-			strlen(namespace), namespace,
-			strlen(name), name);
+			(unsigned long) strlen(namespace), namespace,
+			(unsigned long) strlen(name), name);
 	} else {
-	    prot_printf(backend_inbox->out, "%s %s {%d+}\r\n%s\r\n", 
+	    prot_printf(backend_inbox->out, "%s %s {%lu+}\r\n%s\r\n", 
 			tag, cmd, 
-			strlen(name), name);
+			(unsigned long) strlen(name), name);
 	}
 	pipe_including_tag(backend_inbox, tag, 0);
     } else {
@@ -4154,15 +4164,15 @@
     } else if (!r) {
 	if (rights) {
 	    prot_printf(s->out, 
-			"%s Setacl {%d+}\r\n%s {%d+}\r\n%s {%d+}\r\n%s\r\n",
-			tag, strlen(name), name,
-			strlen(identifier), identifier,
-			strlen(rights), rights);
+			"%s Setacl {%lu+}\r\n%s {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
+			tag, (unsigned long) strlen(name), name,
+			(unsigned long) strlen(identifier), identifier,
+			(unsigned long) strlen(rights), rights);
 	} else {
 	    prot_printf(s->out, 
-			"%s Deleteacl {%d+}\r\n%s {%d+}\r\n%s\r\n",
-			tag, strlen(name), name,
-			strlen(identifier), identifier);
+			"%s Deleteacl {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
+			tag, (unsigned long) strlen(name), name,
+			(unsigned long) strlen(identifier), identifier);
 	}	    
 	res = pipe_including_tag(s, tag, 0);
 	tag = "*";		/* can't send another tagged response */
@@ -4253,26 +4263,25 @@
 						proxyd_userid, mailboxname);
     if (!r) r = mlookup(mailboxname, &server, NULL, NULL);
 
-    if(proxyd_userisadmin) {
+    if(!r && proxyd_userisadmin) {
 	/* If they are an admin, they won't retain that privledge if we
 	 * proxy for them, so we need to refer them -- even if they haven't
 	 * told us they're able to handle it. */
 	proxyd_refer(tag, server, name);
-    } else {
-	if (!r) s = proxyd_findserver(server);
+    } else if (!r) {
+	s = proxyd_findserver(server);
 
 	if (s) {
-	    prot_printf(s->out, "%s Getquotaroot {%d+}\r\n%s\r\n",
-			tag, strlen(name), name);
+	    prot_printf(s->out, "%s Getquotaroot {%lu+}\r\n%s\r\n",
+			tag, (unsigned long) strlen(name), name);
 	    pipe_including_tag(s, tag, 0);
 	} else {
 	    r = IMAP_SERVER_UNAVAILABLE;
 	}
-
-	if (r) {
-	    prot_printf(proxyd_out, "%s NO %s\r\n", tag, error_message(r));
-	    return;
-	}
+    }
+
+    if (r) {
+	prot_printf(proxyd_out, "%s NO %s\r\n", tag, error_message(r));
     }
 }
 
@@ -4489,8 +4498,8 @@
     if (!r) s = proxyd_findserver(server);
     if (!r && !s) r = IMAP_SERVER_UNAVAILABLE;
     if (!r) {
-	prot_printf(s->out, "%s Status {%d+}\r\n%s ", tag,
-		    strlen(name), name);
+	prot_printf(s->out, "%s Status {%lu+}\r\n%s ", tag,
+		    (unsigned long) strlen(name), name);
 	if (!pipe_command(s, 65536)) {
 	    pipe_until_tag(s, tag, 0);
 	}
@@ -4630,7 +4639,7 @@
 
     /* if it's too long, literal it */
     if (*p || len >= 1024) {
-	prot_printf(proxyd_out, "{%u}\r\n%s", strlen(s), s);
+	prot_printf(proxyd_out, "{%lu}\r\n%s", (unsigned long) strlen(s), s);
     } else {
 	prot_printf(proxyd_out, "\"%s\"", s);
     }
@@ -4658,7 +4667,7 @@
 
     /* if it's too long, literal it */
     if (*p || len >= 1024) {
-	prot_printf(proxyd_out, "{%u}\r\n%s", strlen(s), s);
+	prot_printf(proxyd_out, "{%lu}\r\n%s", (unsigned long) strlen(s), s);
     } else {
 	prot_printf(proxyd_out, "\"%s\"", s);
     }

Modified: branches/idled/imap/quota.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/quota.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/quota.c (original)
+++ branches/idled/imap/quota.c Sat May  6 14:53:33 2006
@@ -208,7 +208,7 @@
 void usage(void)
 {
     fprintf(stderr,
-	    "usage: quota [-C <alt_config>] [-d <domain>] [-f] [prefix]...\n");
+	    "usage: cyrquota [-C <alt_config>] [-d <domain>] [-f] [prefix]...\n");
     exit(EC_USAGE);
 }    
 

Modified: branches/idled/imap/reconstruct.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/reconstruct.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/reconstruct.c (original)
+++ branches/idled/imap/reconstruct.c Sat May  6 14:53:33 2006
@@ -345,8 +345,8 @@
 void usage(void)
 {
     fprintf(stderr,
-	    "usage: reconstruct [-C <alt_config>] [-p partition] [-rfx] mailbox...\n");
-    fprintf(stderr, "       reconstruct [-C <alt_config>] -m\n");
+	    "usage: cyrreconstruct [-C <alt_config>] [-p partition] [-rfx] mailbox...\n");
+    fprintf(stderr, "       cyrreconstruct [-C <alt_config>] -m\n");
     exit(EC_USAGE);
 }    
 

Modified: branches/idled/imap/signals.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/signals.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/signals.c (original)
+++ branches/idled/imap/signals.c Sat May  6 14:53:33 2006
@@ -50,7 +50,7 @@
 #include "xmalloc.h"
 #include "exitcodes.h"
 
-static int gotsignal = 0;
+static volatile int gotsignal = 0;
 
 static void sighandler(int sig)
 {

Modified: branches/idled/imap/spool.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/spool.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/spool.c (original)
+++ branches/idled/imap/spool.c Sat May  6 14:53:33 2006
@@ -140,6 +140,7 @@
     state s = NAME_START;
     int r = 0;
     int reject8bit = config_getswitch(IMAPOPT_REJECT8BIT);
+    int munge8bit = config_getswitch(IMAPOPT_MUNGE8BIT);
     const char **skip = NULL;
 
     if (namelen == 0) {
@@ -266,7 +267,7 @@
 			   form. */
 			r = IMAP_MESSAGE_CONTAINS8BIT;
 			goto ph_error;
-		    } else {
+		    } else if (munge8bit) {
 			/* We have been configured to munge all mail of this
 			   form. */
 			c = 'X';

Modified: branches/idled/imap/tls.c
URL: https://mail.incase.de/viewcvs/branches/idled/imap/tls.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/tls.c (original)
+++ branches/idled/imap/tls.c Sat May  6 14:53:33 2006
@@ -166,7 +166,7 @@
  * tim - this seems to just be giving logging messages
  */
 
-static void apps_ssl_info_callback(SSL * s, int where, int ret)
+static void apps_ssl_info_callback(const SSL * s, int where, int ret)
 {
     char   *str;
     int     w;
@@ -678,7 +678,7 @@
     s_key_file = config_getstring(IMAPOPT_TLS_KEY_FILE);
 
     if (!set_cert_stuff(s_ctx, s_cert_file, s_key_file)) {
-	syslog(LOG_ERR,"TLS server engine: cannot load cert/key data");
+	syslog(LOG_ERR,"TLS server engine: cannot load cert/key data, may be a cert/key mismatch?");
 	return (-1);
     }
     SSL_CTX_set_tmp_rsa_callback(s_ctx, tmp_rsa_cb);
@@ -1097,7 +1097,7 @@
     
     if (c_cert_file || c_key_file) {
 	if (!set_cert_stuff(c_ctx, c_cert_file, c_key_file)) {
-	    syslog(LOG_ERR,"TLS client engine: cannot load cert/key data");
+	    syslog(LOG_ERR,"TLS client engine: cannot load cert/key data, may be a cert/key mismatch?");
 	    return (-1);
 	}
     }

Modified: branches/idled/imap/xversion.sh
URL: https://mail.incase.de/viewcvs/branches/idled/imap/xversion.sh?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imap/xversion.sh (original)
+++ branches/idled/imap/xversion.sh Sat May  6 14:53:33 2006
@@ -22,4 +22,4 @@
 	match ($0, pattern) {
 	    printf "\"%s\"\n", substr($0, RSTART, RLENGTH)
 	}' pattern="$DATEPAT $TIMEPAT" | \
-	sort | tail -1 >> xversion.h
+	sort | tail -n 1 >> xversion.h

Modified: branches/idled/imtest/imtest.c
URL: https://mail.incase.de/viewcvs/branches/idled/imtest/imtest.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/imtest/imtest.c (original)
+++ branches/idled/imtest/imtest.c Sat May  6 14:53:33 2006
@@ -63,6 +63,7 @@
 
 #include <limits.h>
 #include <unistd.h>
+#include <ctype.h>
 
 #include <netinet/in.h>
 #include <sys/un.h>
@@ -417,7 +418,7 @@
  * tim - this seems to just be giving logging messages
  */
 
-static void apps_ssl_info_callback(SSL * s, int where, int ret)
+static void apps_ssl_info_callback(const SSL * s, int where, int ret)
 {
     char   *str;
     int     w;
@@ -530,7 +531,7 @@
     
     if (c_cert_file || c_key_file)
 	if (!set_cert_stuff(tls_ctx, c_cert_file, c_key_file)) {
-	    printf("TLS engine: cannot load cert/key data\n");
+	    printf("TLS engine: cannot load cert/key data, maybe a cert/key mismatch?\n");
 	    return IMTEST_FAIL;
 	}
     SSL_CTX_set_tmp_rsa_callback(tls_ctx, tmp_rsa_cb);
@@ -624,14 +625,14 @@
 	return (ret);
     
     if (cmd == (BIO_CB_READ | BIO_CB_RETURN)) {
-	printf("read from %08X [%08lX] (%d bytes => %ld (0x%X))\n",
-	       (unsigned int) bio, (long unsigned int) argp,
+	printf("read from %p [%p] (%d bytes => %ld (0x%X))\n",
+	       (void*) bio, (void*) argp,
 	       argi, ret, (unsigned int) ret);
 	tls_dump(argp, (int) ret);
 	return (ret);
     } else if (cmd == (BIO_CB_WRITE | BIO_CB_RETURN)) {
-	printf("write to %08X [%08lX] (%d bytes => %ld (0x%X))\n",
-	       (unsigned int) bio, (long unsigned int) argp,
+	printf("write to %p [%p] (%d bytes => %ld (0x%X))\n",
+	       (void*) bio, (void*) argp,
 	       argi, ret, (unsigned int) ret);
 	tls_dump(argp, (int) ret);
     }
@@ -1224,7 +1225,7 @@
 	
 	/* can't have this and a file for input */
 	sunsock.sun_family = AF_UNIX;
-	strcpy(sunsock.sun_path, output_socket);
+	strlcpy(sunsock.sun_path, output_socket, sizeof(sunsock.sun_path));
 	unlink(output_socket);
 
 	listen_sock = socket(AF_UNIX, SOCK_STREAM, 0);
@@ -1771,7 +1772,8 @@
 {
     int lup;
     
-    prot_printf(pout,"A003 APPEND %s (\\Seen) {%u}\r\n",mbox,size+strlen(HEADERS));
+    prot_printf(pout,"A003 APPEND %s (\\Seen) {%lu}\r\n",mbox,
+		    (unsigned long) size+strlen(HEADERS));
     /* do normal header foo */
     prot_printf(pout,HEADERS);
     

Modified: branches/idled/installsieve/Makefile.in
URL: https://mail.incase.de/viewcvs/branches/idled/installsieve/Makefile.in?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/installsieve/Makefile.in (original)
+++ branches/idled/installsieve/Makefile.in Sat May  6 14:53:33 2006
@@ -48,7 +48,7 @@
 
 DEFS = @DEFS@
 CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)/../lib @CPPFLAGS@ @SASLFLAGS@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ @WARNERROR@
 LDFLAGS = @LDFLAGS@
 
 INSTALL = @INSTALL@

Modified: branches/idled/lib/Makefile.in
URL: https://mail.incase.de/viewcvs/branches/idled/lib/Makefile.in?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/lib/Makefile.in (original)
+++ branches/idled/lib/Makefile.in Sat May  6 14:53:33 2006
@@ -62,7 +62,7 @@
 LIBS = @LIBS@
 
 MAKEDEPEND_CFLAGS = @CFLAGS@
-CFLAGS = @CFLAGS@ @PERL_CCCDLFLAGS@
+CFLAGS = @CFLAGS@ @PERL_CCCDLFLAGS@ @WARNERROR@ -fPIC
 LDFLAGS = @LDFLAGS@
 
 SHELL = /bin/sh

Modified: branches/idled/lib/acl_afs.c
URL: https://mail.incase.de/viewcvs/branches/idled/lib/acl_afs.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/lib/acl_afs.c (original)
+++ branches/idled/lib/acl_afs.c Sat May  6 14:53:33 2006
@@ -114,6 +114,7 @@
 cyrus_acl_canonproc_t *canonproc;
 void *canonrock;
 {
+    const char *canonid;
     char *newidentifier = 0;
     char *newacl;
     char *thisid, *nextid;
@@ -122,9 +123,14 @@
 
     /* Convert 'identifier' into canonical form */
     if (*identifier == '-') {
-	char *canonid = auth_canonifyid(identifier+1, 0);
+	canonid = auth_canonifyid(identifier+1, 0);
 	if (!canonid) {
-	    return -1;
+	    if (access != 0L) {
+		return -1;
+	    } else {
+		/* trying to delete invalid/non-existent identifier */
+		canonid = identifier+1;
+	    }
 	}
 	newidentifier = xmalloc(strlen(canonid)+2);
 	newidentifier[0] = '-';
@@ -135,9 +141,13 @@
 	}
     }
     else {
-	identifier = auth_canonifyid(identifier, 0);
-	if (!identifier) {
+	canonid = auth_canonifyid(identifier, 0);
+	if (canonid) {
+	    identifier = canonid;
+	} else if (access != 0L) {
 	    return -1;
+	} else {
+	    /* trying to delete invalid/non-existent identifier */
 	}
 	if (canonproc) {
 	    access = canonproc(canonrock, identifier, access);

Modified: branches/idled/lib/imapoptions
URL: https://mail.incase.de/viewcvs/branches/idled/lib/imapoptions?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/lib/imapoptions (original)
+++ branches/idled/lib/imapoptions Sat May  6 14:53:33 2006
@@ -187,7 +187,11 @@
    mailbox that does not have a parent mailbox. */
 
 { "defaultdomain", NULL, STRING }
-/* The default domain for virtual domain support */
+/* The default domain for virtual domain support. Note that this domain
+   is stripped from the email-address transmitted using LMTP, but it
+   is not stripped from usernames at login-time. For imapd/pop3d, 
+   "user" and "user at defaultdomain" specify two different users.
+   Please check install-virtdomains.html for details. */
 
 { "defaultpartition", "default", STRING }
 /* The partition name used by default for new mailboxes. */
@@ -440,7 +444,10 @@
 /* The list of remote realms whose users may authenticate using cross-realm
    authentication identifiers.  Seperate each realm name by a space.  (A
    cross-realm identity is considered any identity returned by SASL
-   with an "@" in it.). */
+   with an "@" in it.) Note that to support multiple virtual domains
+   on the same interface/IP, you need to list them all as loginreals.
+   If you don't list them here, your users probably won't be able to
+   log in. */
 
 { "loginuseacl", 0, SWITCH }
 /* If enabled, any authentication identity which has \fBa\fR rights on a
@@ -461,6 +468,11 @@
 
 { "mboxlist_db", "skiplist", STRINGLIST("flat", "berkeley", "berkeley-hash", "skiplist")}
 /* The cyrusdb backend to use for the mailbox list. */
+
+{ "munge8bit", 1, SWITCH }
+/* If enabled, lmtpd changes 8-bit characters to `X'. Also see reject8bit.
+   (A proper soultion to non-ASCII characters in headers is offered by  
+   RFC 2047 and its predecessors.) */
 
 # xxx badly worded
 { "mupdate_connections_max", 128, INT }
@@ -696,9 +708,9 @@
 
 { "reject8bit", 0, SWITCH }
 /* If enabled, lmtpd rejects messages with 8-bit characters in the
-   headers.  Otherwise, 8-bit characters are changed to `X'.  (A
-   proper soultion to non-ASCII characters in headers is offered by  
-   RFC 2047 and its predecessors.) */
+   headers. Also see munge8bit, which is only applied if reject8bit is
+   not activated. (A proper soultion to non-ASCII characters in headers
+   is offered by RFC 2047 and its predecessors.) */
 
 { "rfc2046_strict", 0, SWITCH }
 /* If enabled, imapd will be strict (per RFC 2046) when matching MIME

Modified: branches/idled/lib/imclient.c
URL: https://mail.incase.de/viewcvs/branches/idled/lib/imclient.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/lib/imclient.c (original)
+++ branches/idled/lib/imclient.c Sat May  6 14:53:33 2006
@@ -1733,7 +1733,7 @@
 
     if (c_cert_file || c_key_file)
 	if (!set_cert_stuff(imclient->tls_ctx, c_cert_file, c_key_file)) {
-	    printf("[ TLS engine: cannot load cert/key data ]\n");
+	    printf("[ TLS engine: cannot load cert/key data, might be a cert/key mismatch]\n");
 	    return -1;
 	}
     SSL_CTX_set_tmp_rsa_callback(imclient->tls_ctx, tmp_rsa_cb);

Modified: branches/idled/lib/lock.h
URL: https://mail.incase.de/viewcvs/branches/idled/lib/lock.h?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/lib/lock.h (original)
+++ branches/idled/lib/lock.h Sat May  6 14:53:33 2006
@@ -53,6 +53,8 @@
 
 #include <sys/stat.h>
 
+extern int lock_wait_time;
+
 extern const char *lock_method_desc;
 
 extern int lock_reopen P((int fd, const char *filename,

Modified: branches/idled/lib/lock_fcntl.c
URL: https://mail.incase.de/viewcvs/branches/idled/lib/lock_fcntl.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/lib/lock_fcntl.c (original)
+++ branches/idled/lib/lock_fcntl.c Sat May  6 14:53:33 2006
@@ -47,10 +47,42 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
+#include <syslog.h>
+#include <signal.h>
 
 #include "lock.h"
 
 const char *lock_method_desc = "fcntl";
+
+int lock_wait_time = LOCK_GIVEUP_TIMER_DEFAULT;
+
+/* Signal handling. We REQUIRE SYSV abort-syscall behaviour */
+
+static volatile int lock_gotsigalrm = 0;
+void lock_sigalrm_handler(int sig __attribute__((unused)))
+{
+    lock_gotsigalrm = 1;
+}
+
+static int setsigalrm(int enable)
+{
+    struct sigaction action;
+
+    sigemptyset(&action.sa_mask);
+    action.sa_flags = SA_RESETHAND;
+
+    if(enable) {
+	action.sa_handler = lock_sigalrm_handler;
+    } else {
+	action.sa_handler = SIG_IGN;
+    }
+    if (sigaction(SIGALRM, &action, NULL) < 0) {
+	syslog(LOG_ERR, "installing SIGALRM handler: sigaction: %m");
+	return -1;
+    }
+    lock_gotsigalrm = 0;
+    return 0;
+}
 
 /*
  * Block until we obtain an exclusive lock on the file descriptor 'fd',
@@ -65,12 +97,10 @@
  * 'failaction' is provided, it is filled in with a pointer to a fixed
  * string naming the action that failed.
  *
- */
-int lock_reopen(fd, filename, sbuf, failaction)
-int fd;
-const char *filename;
-struct stat *sbuf;
-const char **failaction;
+ * We use POSIX semanthics and alarm() to avoid deadlocks
+ *
+ */
+int lock_reopen (int fd, const char *filename, struct stat *sbuf, const char **failaction)
 {
     int r;
     struct flock fl;
@@ -79,6 +109,8 @@
 
     if (!sbuf) sbuf = &sbufspare;
 
+    setsigalrm(1);
+    alarm(lock_wait_time);
     for (;;) {
 	fl.l_type= F_WRLCK;
 	fl.l_whence = SEEK_SET;
@@ -86,8 +118,10 @@
 	fl.l_len = 0;
 	r = fcntl(fd, F_SETLKW, &fl);
 	if (r == -1) {
-	    if (errno == EINTR) continue;
-	    if (failaction) *failaction = "locking";
+	    if (errno == EINTR && !lock_gotsigalrm) continue;
+ 	    if (failaction) *failaction = "locking";
+	    alarm(0);
+	    setsigalrm(0);
 	    return -1;
 	}
 
@@ -100,10 +134,16 @@
 	    fl.l_start = 0;
 	    fl.l_len = 0;
 	    r = fcntl(fd, F_SETLKW, &fl);
+	    alarm(0);
+	    setsigalrm(0);
 	    return -1;
 	}
 
-	if (sbuf->st_ino == sbuffile.st_ino) return 0;
+	if (sbuf->st_ino == sbuffile.st_ino) {
+	    alarm(0);
+	    setsigalrm(0);
+	    return 0;
+	}
 
 	newfd = open(filename, O_RDWR);
 	if (newfd == -1) {
@@ -113,11 +153,15 @@
 	    fl.l_start = 0;
 	    fl.l_len = 0;
 	    r = fcntl(fd, F_SETLKW, &fl);
+	    alarm(0);
+	    setsigalrm(0);
 	    return -1;
 	}
 	dup2(newfd, fd);
 	close(newfd);
     }
+    alarm(0);
+    setsigalrm(0);
 }
 
 /*
@@ -125,22 +169,32 @@
  * Returns 0 for success, -1 for failure, with errno set to an
  * appropriate error code.
  */
-int lock_blocking(fd)
-int fd;
-{
-    int r;
-    struct flock fl;
-
+int lock_blocking(int fd)
+{
+    int r;
+    struct flock fl;
+
+    setsigalrm(1);
+    alarm(lock_wait_time);
     for (;;) {
 	fl.l_type= F_WRLCK;
 	fl.l_whence = SEEK_SET;
 	fl.l_start = 0;
 	fl.l_len = 0;
 	r = fcntl(fd, F_SETLKW, &fl);
-	if (r != -1) return 0;
-	if (errno == EINTR) continue;
-	return -1;
-    }
+	if (r != -1) {
+	    alarm(0);
+	    setsigalrm(0);
+	    return 0;
+	}
+	if (errno == EINTR && !lock_gotsigalrm) continue;
+	alarm(0);
+	setsigalrm(0);
+	return -1;
+    }
+    alarm(0);
+    setsigalrm(0);
+    return 0;
 }
 
 /*
@@ -148,22 +202,32 @@
  * Returns 0 for success, -1 for failure, with errno set to an
  * appropriate error code.
  */
-int lock_shared(fd)
-int fd;
-{
-    int r;
-    struct flock fl;
-
+int lock_shared(int fd)
+{
+    int r;
+    struct flock fl;
+
+    setsigalrm(1);
+    alarm(lock_wait_time);
     for (;;) {
 	fl.l_type= F_RDLCK;
 	fl.l_whence = SEEK_SET;
 	fl.l_start = 0;
 	fl.l_len = 0;
 	r = fcntl(fd, F_SETLKW, &fl);
-	if (r != -1) return 0;
-	if (errno == EINTR) continue;
-	return -1;
-    }
+	if (r != -1) {
+	    alarm(0);
+	    setsigalrm(0);
+	    return 0;
+	}
+	if (errno == EINTR && !lock_gotsigalrm) continue;
+	alarm(0);
+	setsigalrm(0);
+	return -1;
+    }
+    alarm(0);
+    setsigalrm(0);
+    return 0;
 }
 
 /*
@@ -171,8 +235,7 @@
  * Returns 0 for success, -1 for failure, with errno set to an
  * appropriate error code.
  */
-int lock_nonblocking(fd)
-int fd;
+int lock_nonblocking(int fd)
 {
     int r;
     struct flock fl;
@@ -187,10 +250,13 @@
 	if (errno == EINTR) continue;
 	return -1;
     }
-}
-
-/*
- * Release any lock on 'fd'.  Always returns success.
+    return 0;
+}
+
+/*
+ * Release any lock on 'fd'
+ * Returns 0 for success, -1 for failure, with errno set to an
+ * appropriate error code.
  */
 int lock_unlock(int fd)
 { 
@@ -209,5 +275,6 @@
         /* xxx help! */
         return -1;
     }
-}
-
+    return 0;
+}
+

Modified: branches/idled/lib/lock_flock.c
URL: https://mail.incase.de/viewcvs/branches/idled/lib/lock_flock.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/lib/lock_flock.c (original)
+++ branches/idled/lib/lock_flock.c Sat May  6 14:53:33 2006
@@ -46,6 +46,8 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <errno.h>
+#include <syslog.h>
+#include <signal.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -53,6 +55,36 @@
 #include "lock.h"
 
 const char *lock_method_desc = "flock";
+
+int lock_wait_time = LOCK_GIVEUP_TIMER_DEFAULT;
+
+/* Signal handling. We REQUIRE SYSV abort-syscall behaviour */
+
+static volatile int lock_gotsigalrm = 0;
+void lock_sigalrm_handler(int sig __attribute__((unused)))
+{
+    lock_gotsigalrm = 1;
+}
+
+static int setsigalrm(int enable)
+{
+    struct sigaction action;
+
+    sigemptyset(&action.sa_mask);
+    action.sa_flags = SA_RESETHAND;
+
+    if(enable) {
+	action.sa_handler = lock_sigalrm_handler;
+    } else {
+	action.sa_handler = SIG_IGN;
+    }
+    if (sigaction(SIGALRM, &action, NULL) < 0) {
+	syslog(LOG_ERR, "installing SIGALRM handler: sigaction: %m");
+	return -1;
+    }
+    lock_gotsigalrm = 0;
+    return 0;
+}
 
 /*
  * Block until we obtain an exclusive lock on the file descriptor 'fd',
@@ -67,12 +99,10 @@
  * 'failaction' is provided, it is filled in with a pointer to a fixed
  * string naming the action that failed.
  *
- */
-int lock_reopen(fd, filename, sbuf, failaction)
-int fd;
-const char *filename;
-struct stat *sbuf;
-const char **failaction;
+ * We use POSIX semanthics and alarm() to avoid deadlocks
+ *
+ */
+int lock_reopen(int fd, const char *filename, struct stat *sbuf, const char **failaction)
 {
     int r;
     struct stat sbuffile, sbufspare;
@@ -80,11 +110,15 @@
 
     if (!sbuf) sbuf = &sbufspare;
 
+    setsigalrm(1);
+    alarm(lock_wait_time);
     for (;;) {
 	r = flock(fd, LOCK_EX);
 	if (r == -1) {
-	    if (errno == EINTR) continue;
+	    if (errno == EINTR && !lock_gotsigalrm) continue;
 	    if (failaction) *failaction = "locking";
+	    alarm(0);
+	    setsigalrm(0);
 	    return -1;
 	}
 
@@ -93,20 +127,32 @@
 	if (r == -1) {
 	    if (failaction) *failaction = "stating";
 	    flock(fd, LOCK_UN);
+	    alarm(0);
+	    setsigalrm(0);
 	    return -1;
 	}
 
-	if (sbuf->st_ino == sbuffile.st_ino) return 0;
+	if (sbuf->st_ino == sbuffile.st_ino) {
+	    alarm(0);
+	    setsigalrm(0);
+	    return 0;
+	}
+ 
 
 	newfd = open(filename, O_RDWR);
 	if (newfd == -1) {
 	    if (failaction) *failaction = "opening";
 	    flock(fd, LOCK_UN);
+	    alarm(0);
+	    setsigalrm(0);
 	    return -1;
 	}
 	dup2(newfd, fd);
 	close(newfd);
     }
+    alarm(0);
+    setsigalrm(0);
+    return 0;
 }
 
 /*
@@ -114,17 +160,27 @@
  * Returns 0 for success, -1 for failure, with errno set to an
  * appropriate error code.
  */
-int lock_blocking(fd)
-int fd;
-{
-    int r;
-
+int lock_blocking(int fd)
+{
+    int r;
+
+    setsigalrm(1);
+    alarm(lock_wait_time);
     for (;;) {
 	r = flock(fd, LOCK_EX);
-	if (r != -1) return 0;
-	if (errno == EINTR) continue;
-	return -1;
-    }
+	if (r != -1) {
+	    alarm(0);
+	    setsigalrm(0);
+	    return 0;
+	}
+	if (errno == EINTR && !lock_gotsigalrm) continue;
+	alarm(0);
+	setsigalrm(0);
+	return -1;
+    }
+    alarm(0);
+    setsigalrm(0);
+    return 0;
 }
 
 /*
@@ -132,17 +188,27 @@
  * Returns 0 for success, -1 for failure, with errno set to an
  * appropriate error code.
  */
-int lock_shared(fd)
-int fd;
-{
-    int r;
-
+int lock_shared(int fd)
+{
+    int r;
+
+    setsigalrm(1);
+    alarm(lock_wait_time);
     for (;;) {
 	r = flock(fd, LOCK_SH);
-	if (r != -1) return 0;
-	if (errno == EINTR) continue;
-	return -1;
-    }
+	if (r != -1) {
+	    alarm(0);
+	    setsigalrm(0);
+	    return 0;
+	}
+	if (errno == EINTR && !lock_gotsigalrm) continue;
+	alarm(0);
+	setsigalrm(0);
+	return -1;
+    }
+    alarm(0);
+    setsigalrm(0);
+    return 0;
 }
 
 /*
@@ -164,7 +230,9 @@
 }
 
 /*
- * Release any lock on 'fd'.  Always returns success.
+ * Release any lock on 'fd'.
+ * Returns 0 for success, -1 for failure, with errno set to an
+ * appropriate error code.
  */
 int lock_unlock(int fd)
 {
@@ -174,8 +242,8 @@
         r = flock(fd, LOCK_UN);
         if (r != -1) return 0;
         if (errno == EINTR) continue;
-        /* xxx help! */
         return -1;
     }
-}
-
+    return 0;
+}
+

Modified: branches/idled/lib/map_stupidshared.c
URL: https://mail.incase.de/viewcvs/branches/idled/lib/map_stupidshared.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/lib/map_stupidshared.c (original)
+++ branches/idled/lib/map_stupidshared.c Sat May  6 14:53:33 2006
@@ -52,6 +52,7 @@
 #include <sys/stat.h>
 #include <syslog.h>
 
+#include "xmalloc.h"
 #include "map.h"
 #include "exitcodes.h"
 

Modified: branches/idled/lib/xmalloc.h
URL: https://mail.incase.de/viewcvs/branches/idled/lib/xmalloc.h?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/lib/xmalloc.h (original)
+++ branches/idled/lib/xmalloc.h Sat May  6 14:53:33 2006
@@ -57,7 +57,7 @@
 
 /* Functions using xmalloc.h must provide a function called fatal() conforming
    to the following: */
-extern void fatal(const char *fatal_message, int fatal_code);
-/*   __attribute__ ((noreturn));*/
+extern void fatal(const char *fatal_message, int fatal_code)
+   __attribute__ ((noreturn));
 
 #endif /* INCLUDED_XMALLOC_H */

Modified: branches/idled/man/chk_cyrus.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/chk_cyrus.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/chk_cyrus.8 (original)
+++ branches/idled/man/chk_cyrus.8 Sat May  6 14:53:33 2006
@@ -83,4 +83,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR

Modified: branches/idled/man/ctl_cyrusdb.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/ctl_cyrusdb.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/ctl_cyrusdb.8 (original)
+++ branches/idled/man/ctl_cyrusdb.8 Sat May  6 14:53:33 2006
@@ -94,4 +94,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR

Modified: branches/idled/man/ctl_deliver.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/ctl_deliver.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/ctl_deliver.8 (original)
+++ branches/idled/man/ctl_deliver.8 Sat May  6 14:53:33 2006
@@ -78,4 +78,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR

Modified: branches/idled/man/ctl_mboxlist.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/ctl_mboxlist.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/ctl_mboxlist.8 (original)
+++ branches/idled/man/ctl_mboxlist.8 Sat May  6 14:53:33 2006
@@ -104,7 +104,9 @@
 .TP
 .B \-d
 Dump the contents of the database to standard output in a portable
-flat-text format.
+flat-text format.  NOTE: In Cyrus versions 2.2.13 and earlier, the dump
+format did not include the mailbox type flags, breaking remote
+mailboxes (frontends, mupdate master) when undumped.
 .TP
 .B \-x
 When performing a dump, remove the mailboxes dumped from the mailbox list
@@ -115,7 +117,9 @@
 .TP
 .B \-u
 Load the contents of the database from standard input.  The input MUST
-be in the format output using the \fB\-d\fR option.
+be in the format output using the \fB\-d\fR option.  NOTE: Both the
+old and new formats can be loaded, but the old format will break
+remote mailboxes.
 .TP
 .B \-m
 For backend servers in the Cyrus Murder, synchronize the local mailbox list
@@ -138,4 +142,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR

Modified: branches/idled/man/cyr_expire.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/cyr_expire.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/cyr_expire.8 (original)
+++ branches/idled/man/cyr_expire.8 Sat May  6 14:53:33 2006
@@ -90,4 +90,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR

Modified: branches/idled/man/cyrus.conf.5
URL: https://mail.incase.de/viewcvs/branches/idled/man/cyrus.conf.5?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/cyrus.conf.5 (original)
+++ branches/idled/man/cyrus.conf.5 Sat May  6 14:53:33 2006
@@ -44,9 +44,9 @@
 cyrus.conf \- Cyrus configuration file
 .SH DESCRIPTION
 \fB/etc/cyrus.conf\fR 
-is the configuration file for the Cyrus \fBmaster\fR process.  It
+is the configuration file for the Cyrus \fBcyrmaster\fR process.  It
 defines the startup procedures, services and events to be spawned by
-\fBmaster\fR.
+\fBcyrmaster\fR.
 .PP
 The \fB/etc/cyrus.conf\fR file consists of a series of entries divided
 into sections of the form
@@ -105,7 +105,7 @@
 \fR[ \fIhost\fR \fB: \fR] \fIport\fR
 .br
 .sp
-where \fIpath\fR is the explicit path to a UNIX socket, \fIhost\fR is
+where \fIpath\fR is the explicit (absolute) path to a UNIX socket, \fIhost\fR is
 either the hostname or bracket-enclosed IP address of a network
 interface, and \fIport\fR is either a port number or service name (as listed
 in \fB/etc/services\fR).
@@ -125,12 +125,22 @@
 The number of instances of this service to always have running and
 waiting for a connection (for faster initial response time).  This
 integer value is optional.
+.br
+.sp
+For datagram-based services (udp), the maximum value of prefork is 1.
 .IP "\fBmaxchild=\fR-1" 5
 The maximum number of instances of this service to spawn.  A value of
 -1 means unlimited.  This integer value is optional.
 .IP "\fBmaxfds=\fR256" 5
 The maximum number of file descriptors to which to limit this process.
 This integer value is optional.
+.IP "\fBmaxforkrate=\fR0" 5
+Maximum number of forks per second for this service.  A value of zero
+means unlimited fork rate.  This integer value is optional.
+.IP "\fBbabysit=\fR0" 5
+Set to non-zero to guarantee that at least one child will always be
+available for new connections.  The value of maxchild is ignored if all
+children are busy and babysit is active.  This integer value is optional.
 .SS EVENTS
 This section lists processes that should be run at specific intervals,
 similar to cron jobs.  This section is typically used to perform
@@ -177,6 +187,6 @@
 still have separate access control rules.
 .SH SEE ALSO
 .PP
-\fBmaster(8)\fR, \fBimapd(8)\fR, \fBpop3d(8)\fR, \fBlmtpd(8)\fR,
+\fBcyrmaster(8)\fR, \fBimapd(8)\fR, \fBpop3d(8)\fR, \fBlmtpd(8)\fR,
 \fBtimsieved(8)\fR, \fBidled(8)\fR, \fBnotifyd(8)\fR, \fBctl_cyrusdb(8)\fR,
 \fBctl_deliver(8)\fR, \fBtls_prune(8)\fR, \fBhosts_access(5)\fR

Modified: branches/idled/man/deliver.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/deliver.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/deliver.8 (original)
+++ branches/idled/man/deliver.8 Sat May  6 14:53:33 2006
@@ -1,5 +1,5 @@
 .\" -*- nroff -*-
-.TH DELIVER 8 "Project Cyrus" CMU
+.TH CYRDELIVER 8 "Project Cyrus" CMU
 .\" 
 .\" Copyright (c) 1998-2000 Carnegie Mellon University.  All rights reserved.
 .\"
@@ -41,9 +41,9 @@
 .\" 
 .\" $Id: deliver.8,v 1.18 2004/06/21 18:40:10 rjs3 Exp $
 .SH NAME
-deliver \- deliver mail to an IMAP mailbox
+cyrdeliver \- deliver mail to an IMAP mailbox
 .SH SYNOPSIS
-.B deliver
+.B cyrdeliver
 [
 .B \-C
 .I config-file
@@ -76,7 +76,7 @@
 .I userid
 ]...
 .br
-.B deliver
+.B cyrdeliver
 [
 .B \-C
 .I config-file
@@ -146,7 +146,7 @@
 .B \-l
 Accept messages using the LMTP protocol.
 .SH NOTES
-Depending on the setting of \fBreject8bit\fR in \fBimapd.conf(5)\fR, deliver
+Depending on the setting of \fBreject8bit\fR in \fBimapd.conf(5)\fR, cyrdeliver
 either rejects messages with 8-bit-set characters in the headers or 
 changes these characters to `X'.
 This is because such characters can't be interpreted since the

Modified: branches/idled/man/fud.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/fud.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/fud.8 (original)
+++ branches/idled/man/fud.8 Sat May  6 14:53:33 2006
@@ -61,7 +61,7 @@
 ]
 .SH DESCRIPTION
 .B FUD
-is a long lived datagram daemon started from master that provides
+is a long lived datagram daemon started from cyrmaster that provides
 information about when a user last
 read their mail, when mail last arrived in a user's mailbox, and how
 many messages are recent for that user.

Modified: branches/idled/man/idled.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/idled.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/idled.8 (original)
+++ branches/idled/man/idled.8 Sat May  6 14:53:33 2006
@@ -56,7 +56,7 @@
 to report the changes to the client.
 .I Idled
 is usually started from
-.I master.
+.I cyrmaster.
 .PP
 .I Idled
 reads its configuration options out of the
@@ -75,4 +75,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR

Modified: branches/idled/man/imapd.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/imapd.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/imapd.8 (original)
+++ branches/idled/man/imapd.8 Sat May  6 14:53:33 2006
@@ -72,7 +72,7 @@
 is an IMAP4rev1 server.
 It accepts commands on its standard input and responds on its standard output.
 It MUST be invoked by
-.IR master (8)
+.IR cyrmaster (8)
 with those descriptors attached to a remote client connection.
 .PP
 .I Imapd
@@ -148,4 +148,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR

Modified: branches/idled/man/lmtpd.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/lmtpd.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/lmtpd.8 (original)
+++ branches/idled/man/lmtpd.8 Sat May  6 14:53:33 2006
@@ -68,7 +68,7 @@
 is an LMTP server used to deliver mail to the IMAP mailstore.
 It accepts commands on its standard input and responds on its standard output.
 It MUST be invoked by
-.IR master (8)
+.IR cyrmaster (8)
 with those descriptors attached to a remote client connection.
 .PP
 .I Lmtpd
@@ -101,4 +101,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR

Modified: branches/idled/man/master.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/master.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/master.8 (original)
+++ branches/idled/man/master.8 Sat May  6 14:53:33 2006
@@ -1,5 +1,5 @@
 .\" -*- nroff -*-
-.TH MASTER 8 "Project Cyrus" CMU
+.TH CYRMASTER 8 "Project Cyrus" CMU
 .\" 
 .\" Copyright (c) 1996-2000 Carnegie Mellon University.  All rights reserved.
 .\"
@@ -41,9 +41,9 @@
 .\" 
 .\" $Id: master.8,v 1.13 2004/12/17 16:32:23 ken3 Exp $
 .SH NAME
-master \- master Cyrus process
+cyrmaster \- master Cyrus process
 .SH SYNOPSIS
-.B master
+.B cyrmaster
 [
 .B \-C
 .I alternate imapd.conf
@@ -79,7 +79,7 @@
 .I snmp agentx socket
 ]
 .SH DESCRIPTION
-.I Master
+.I cyrmaster
 is the process that controls all of the Cyrus processes. This process
 is responsible for creating all imapd, pop3d, lmtpd and sieved child
 processes. This process also initializes the Berkeley DB code and
@@ -92,12 +92,12 @@
 .SH OPTIONS
 .TP
 .BI \-C " alternate imapd.conf"
-Specifies an alternate imapd.conf for use by master (note that this will
-not affect any sub-processes spawned by master, you should specify those
+Specifies an alternate imapd.conf for use by cyrmaster (note that this will
+not affect any sub-processes spawned by cyrmaster, you should specify those
 specifically in the respective entries in cyrus.conf).
 .TP
 .BI \-M " alternate cyrus.conf"
-Specifies an alternate cyrus.conf for use by master.
+Specifies an alternate cyrus.conf for use by cyrmaster.
 .TP
 .BI \-l " listen queue backlog"
 Increase the listen queue backlog. By default, the listen queue is set
@@ -113,7 +113,7 @@
 .BI \-p " pidfile"
 Use
 .I pidfile
-as the pidfile.  If not specified, defaults to /var/run/cyrus-master.pid
+as the pidfile.  If not specified, defaults to /var/run/cyrmaster.pid
 .TP
 .BI \-P " snmp agentx ping interval"
 Sets the amount on time in seconds the subagent will try and reconnect to the
@@ -132,12 +132,12 @@
 Requires net-snmp 5.0 or higher.
 .SH CONFIGURATION
 Upon execution,
-.I master
+.I cyrmaster
 reads its configuration information out of the
 .IR cyrus.conf (5)
 file.
 .PP
-.I Master
+.I cyrmaster
 rereads its configuration file when it receives a hangup signal,
 SIGHUP.  Services and events may be added, deleted or modified when the
 configuration file is reread.  Any active services removed from the
@@ -146,9 +146,18 @@
 The environment variable \fBCYRUS_VERBOSE\fR can be set to log additional
 debugging information. Setting the value to 1 results in base level logging. 
 Setting it higher results in more log messages being generated.
+.SH BUGS
+Services do not always go away silently when removed through a SIGHUP.  If
+there are workers of the removed service still running, messages to syslog
+about broken pipes and accept() failures are to be expected.
+.PP
+The in-memory list of services is not cleaned up ever, so a cyrmaster daemon
+that has been sent an extremely high amount of SIGHUP signals to
+add/remove/modify services will lose performance eventually.  Restarting
+cyrmaster fixes this.
 .SH FILES
 .TP
-.B /etc/cyrus.conf, /etc/imapd.conf, /var/run/cyrus-master.pid
+.B /etc/cyrus.conf, /etc/imapd.conf, /var/run/cyrmaster.pid
 .SH SEE ALSO
 .PP
 \fBcyrus.conf(5)\fR, \fBimapd.conf(5)\fR, \fBimapd(8)\fR,

Modified: branches/idled/man/nntpd.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/nntpd.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/nntpd.8 (original)
+++ branches/idled/man/nntpd.8 Sat May  6 14:53:33 2006
@@ -74,7 +74,7 @@
 is a NNTP server.
 It accepts commands on its standard input and responds on its standard output.
 It MUST invoked by
-.IR master (8)
+.IR cyrmaster (8)
 with those descriptors attached to a remote client connection.
 .PP
 .I Nntpd
@@ -142,4 +142,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR

Modified: branches/idled/man/notifyd.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/notifyd.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/notifyd.8 (original)
+++ branches/idled/man/notifyd.8 Sat May  6 14:53:33 2006
@@ -62,7 +62,7 @@
 ]
 .SH DESCRIPTION
 .B Notifyd
-is a daemon started from master(8) that handles notification requests on
+is a daemon started from cyrmaster(8) that handles notification requests on
 behalf of lmtpd(8).
 .B Notifyd
 accepts the request and performs the notification using the method
@@ -122,4 +122,4 @@
 Cyrus Master process configuration file.
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBcyrus.conf\fR, \fBmaster(8)\fR, \fBlmtpd(8)\fR
+\fBimapd.conf(5)\fR, \fBcyrus.conf\fR, \fBcyrmaster(8)\fR, \fBlmtpd(8)\fR

Modified: branches/idled/man/pop3d.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/pop3d.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/pop3d.8 (original)
+++ branches/idled/man/pop3d.8 Sat May  6 14:53:33 2006
@@ -71,7 +71,7 @@
 is a POP3 server.
 It accepts commands on its standard input and responds on its standard output.
 It MUST invoked by
-.IR master (8)
+.IR cyrmaster (8)
 with those descriptors attached to a remote client connection.
 .PP
 .I Pop3d
@@ -121,4 +121,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR

Modified: branches/idled/man/quota.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/quota.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/quota.8 (original)
+++ branches/idled/man/quota.8 Sat May  6 14:53:33 2006
@@ -1,5 +1,5 @@
 .\" -*- nroff -*-
-.TH QUOTA 8 "Project Cyrus" CMU
+.TH CYRQUOTA 8 "Project Cyrus" CMU
 .\" 
 .\" Copyright (c) 1998-2000 Carnegie Mellon University.  All rights reserved.
 .\"
@@ -41,9 +41,9 @@
 .\" 
 .\" $Id: quota.8,v 1.11 2003/10/22 18:50:13 rjs3 Exp $
 .SH NAME
-quota \- report and optionally fix quota usage
+cyrquota \- report and optionally fix quota usage
 .SH SYNOPSIS
-.B quota
+.B cyrquota
 [
 .B \-C
 .I config-file
@@ -59,12 +59,12 @@
 .IR mailbox-prefix ...
 ]
 .SH DESCRIPTION
-.I Quota
+.I cyrquota
 generates a report listing quota roots, giving their limits and usage.
 If the
 .I \-f
 option is given, 
-.I quota
+.I cyrquota
 first fixes any inconsistencies in the quota subsystem, such as
 mailboxes with the wrong quota root or quota roots with the wrong
 quota usage reported.
@@ -79,14 +79,14 @@
 prefixes.
 .PP
 Running
-.I quota
+.I cyrquota
 with both the 
 .I \-f
 option and
 .I mailbox-prefix
 arguments is not recommended.
 .PP
-.I Quota
+.I cyrquota
 reads its configuration options out of the
 .IR imapd.conf (5)
 file unless specified otherwise by \fB-C\fR.

Modified: branches/idled/man/reconstruct.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/reconstruct.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/reconstruct.8 (original)
+++ branches/idled/man/reconstruct.8 Sat May  6 14:53:33 2006
@@ -1,5 +1,5 @@
 .\" -*- nroff -*-
-.TH RECONSTRUCT 8 "Project Cyrus" CMU
+.TH CYRRECONSTRUCT 8 "Project Cyrus" CMU
 .\" 
 .\" Copyright (c) 1998-2000 Carnegie Mellon University.  All rights reserved.
 .\"
@@ -41,9 +41,9 @@
 .\" 
 .\" $Id: reconstruct.8,v 1.19 2004/10/13 18:07:49 shadow Exp $
 .SH NAME
-reconstruct \- reconstruct mailboxes
+cyrreconstruct \- reconstruct mailboxes
 .SH SYNOPSIS
-.B reconstruct
+.B cyrreconstruct
 [
 .B \-C
 .I config-file
@@ -63,14 +63,14 @@
 ]
 .IR mailbox ...
 .br
-.B reconstruct
+.B cyrreconstruct
 [
 .B \-C
 .I config-file
 ]
 .B \-m
 .SH DESCRIPTION
-.I Reconstruct
+.I cyrreconstruct
 rebuilds one or more IMAP mailboxes.  When invoked with the
 .B \-m
 switch, it rebuilds the master
@@ -78,17 +78,17 @@
 almost any sort of data corruption.
 .PP
 If
-.I Reconstruct
+.I cyrreconstruct
 can find existing header and index files, it attempts to preserve any
 data in them that is not derivable from the message files themselves.
 The state 
-.I reconstruct
+.I cyrreconstruct
 attempts to preserve includes the flag names, flag state, and
 internaldate.
-.I Reconstruct
+.I cyrreconstruct
 derives all other information from the message files.
 .PP
-.I Reconstruct
+.I cyrreconstruct
 reads its configuration options out of the
 .IR imapd.conf (5)
 file unless specified otherwise by \fB-C\fR.  Any mailbox directory
@@ -96,12 +96,12 @@
 .I partition-news
 configuration option is assumed to be in news format.
 .PP
-.I Reconstruct
+.I cyrreconstruct
 does not adjust the quota usage recorded in any quota
 root files.  After running
-.IR reconstruct ,
+.IR cyrreconstruct ,
 it is advisable to run
-.IR quota (8)
+.IR cyrquota (8)
 with the
 .I \-f
 switch in order to fix the quota root files.

Modified: branches/idled/man/smmapd.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/smmapd.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/smmapd.8 (original)
+++ branches/idled/man/smmapd.8 Sat May  6 14:53:33 2006
@@ -67,7 +67,7 @@
 It accepts commands on its standard input and responds on its standard
 output.
 It MUST be invoked by
-.IR master (8)
+.IR cyrmaster (8)
 with those descriptors attached to a remote client connection.
 .PP
 .B SMMAPD

Modified: branches/idled/man/timsieved.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/timsieved.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/timsieved.8 (original)
+++ branches/idled/man/timsieved.8 Sat May  6 14:53:33 2006
@@ -53,7 +53,7 @@
 is a server that allows users to remotly manage their sieve scripts kept on the server.
 It accepts commands on its standard input and responds on its standard output.
 It MUST be invoked by
-.IR master (8)
+.IR cyrmaster (8)
 with those descriptors attached to a remote client connection.
 .PP
 .I Timsieved
@@ -70,4 +70,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR

Modified: branches/idled/man/tls_prune.8
URL: https://mail.incase.de/viewcvs/branches/idled/man/tls_prune.8?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/man/tls_prune.8 (original)
+++ branches/idled/man/tls_prune.8 Sat May  6 14:53:33 2006
@@ -67,4 +67,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR

Modified: branches/idled/master/CYRUS-MASTER.mib
URL: https://mail.incase.de/viewcvs/branches/idled/master/CYRUS-MASTER.mib?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/master/CYRUS-MASTER.mib (original)
+++ branches/idled/master/CYRUS-MASTER.mib Sat May  6 14:53:33 2006
@@ -1,12 +1,15 @@
 CYRUS-MASTER-MIB DEFINITIONS ::= BEGIN
 
 IMPORTS
-    MODULE-IDENTITY, OBJECT-TYPE, Counter32
+    MODULE-IDENTITY, OBJECT-TYPE, Counter32, enterprises
         FROM SNMPv2-SMI
     DisplayString
-        FROM SNMPv2-TC
-    cmuCyrus
-        FROM CMU-MIB;
+        FROM SNMPv2-TC;
+--    cmuCyrus
+--        FROM CMU-MIB;
+
+cmuMIB         OBJECT IDENTIFIER ::= { enterprises 3 }
+cmuCyrus       OBJECT IDENTIFIER ::= { cmuMIB 6 }
 
 cyrusMasterMIB MODULE-IDENTITY
     LAST-UPDATED "0010312300Z"		-- 2000 Oct 31

Modified: branches/idled/master/Makefile.in
URL: https://mail.incase.de/viewcvs/branches/idled/master/Makefile.in?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/master/Makefile.in (original)
+++ branches/idled/master/Makefile.in Sat May  6 14:53:33 2006
@@ -57,7 +57,7 @@
 CPPFLAGS = -I.. -I$(srcdir)/../lib -I$(srcdir)/../imap @CPPFLAGS@ @COM_ERR_CPPFLAGS@
 DEPLIBS = @DEPLIBS@
 
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ @WARNERROR@
 LDFLAGS = @LDFLAGS@ @COM_ERR_LDFLAGS@
 LIBS = ../lib/libcyrus_min.a @LIB_UCDSNMP@ @LIBS@ @COM_ERR_LIBS@
 

Modified: branches/idled/master/master.c
URL: https://mail.incase.de/viewcvs/branches/idled/master/master.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/master/master.c (original)
+++ branches/idled/master/master.c Sat May  6 14:53:33 2006
@@ -162,6 +162,8 @@
 static struct centry *ctable[child_table_size];
 static struct centry *cfreelist;
 
+static int child_mourning_time = 2;    /* Time in seconds to remember child
+					  after processing SIGCHLD */
 static int janitor_frequency = 1;	/* Janitor sweeps per second */
 static int janitor_position;		/* Entry to begin at in next sweep */
 static struct timeval janitor_mark;	/* Last time janitor did a sweep */
@@ -186,9 +188,9 @@
 int become_cyrus(void)
 {
     struct passwd *p;
-    int newuid, newgid;
+    uid_t newuid, newgid;
     int result;
-    static int uid = 0;
+    static uid_t uid = 0;
 
     if (uid) return setuid(uid);
 
@@ -222,13 +224,17 @@
     return result;
 }
 
-void get_prog(char *path, unsigned size, char *const *cmd)
+void get_prog(char *path, unsigned int size, char *const *cmd)
 {
     if (cmd[0][0] == '/') {
 	/* master lacks strlcpy, due to no libcyrus */
 	snprintf(path, size, "%s", cmd[0]);
-    }
-    else snprintf(path, size, "%s/%s", SERVICE_PATH, cmd[0]);
+	path[size-1] = '\0';
+    }
+    else {
+	snprintf(path, size, "%s/%s", SERVICE_PATH, cmd[0]);
+	path[size-1] = '\0';
+    }
 }
 
 void get_statsock(int filedes[2])
@@ -911,7 +917,7 @@
 		}
 	    }
 	    c->service_state = SERVICE_STATE_DEAD;
-	    c->janitor_deadline = time(NULL) + 2;
+	    c->janitor_deadline = time(NULL) + child_mourning_time;
 	} else {
 	    /* weird. Are we multithreaded now? we don't know this child */
 	    syslog(LOG_WARNING,
@@ -920,7 +926,7 @@
 	    c = get_centry();
 	    c->pid = pid;
 	    c->service_state = SERVICE_STATE_DEAD;
-	    c->janitor_deadline = time(NULL) + 2;
+	    c->janitor_deadline = time(NULL) + child_mourning_time;
 	    c->si = SERVICE_NONE;
 	    c->next = ctable[pid % child_table_size];
 	    ctable[pid % child_table_size] = c;
@@ -1073,6 +1079,36 @@
     if (sigaction(SIGCHLD, &action, NULL) < 0) {
 	fatal("unable to install signal handler for SIGCHLD: %m", 1);
     }
+}
+
+/*
+ * Receives a message from a service.
+ *
+ * Returns zero if all goes well
+ * 1 if no msg available
+ * 2 if bad message received (incorrectly sized)
+ * -1 on error (errno set)
+ */
+int read_msg(int fd, struct notify_message *msg)
+{
+    ssize_t r;
+    size_t off = 0;
+    int s = sizeof(struct notify_message);
+    
+    while (s > 0) {
+        do
+            r = read(fd, msg + off, s);
+        while ((r == -1) && (errno == EINTR));
+        if (r <= 0) break;
+        s -= r;
+        off += r;
+    }
+    if ( ((r == 0) && (off == 0)) ||
+         ((r == -1) && (errno == EAGAIN)) )
+        return 1;
+    if (r == -1) return -1;
+    if (s != 0) return 2;
+    return 0;
 }
 
 void process_msg(const int si, struct notify_message *msg) 
@@ -1388,8 +1424,9 @@
 	snprintf(buf, sizeof(buf),
 		 "cannot find executable for service '%s'", name);
 	
-	/* if it is not, we're misconfigured, die. */
-	fatal(buf, EX_CONFIG);
+	/* if it is not, we just skip it */
+	syslog(LOG_WARNING, "WARNING: %s -- ignored", buf);
+	return;
     }
 
     Services[i].maxforkrate = maxforkrate;
@@ -1401,7 +1438,7 @@
 	Services[i].desired_workers = prefork;
 	Services[i].babysit = babysit;
 	Services[i].max_workers = atoi(max);
-	if (Services[i].max_workers == -1) {
+	if (Services[i].max_workers < 0) {
 	    Services[i].max_workers = INT_MAX;
 	}
     } else {
@@ -1409,6 +1446,7 @@
 	if (prefork > 1) prefork = 1;
 	Services[i].desired_workers = prefork;
 	Services[i].max_workers = 1;
+	Services[i].babysit = 0;
     }
     free(max);
  
@@ -1448,7 +1486,7 @@
     if (!strcmp(cmd,"")) {
 	char buf[256];
 	snprintf(buf, sizeof(buf),
-		 "unable to find command or port for event '%s'", name);
+		 "unable to find command for event '%s'", name);
 
 	if (ignore_err) {
 	    syslog(LOG_WARNING, "WARNING: %s -- ignored", buf);
@@ -1502,7 +1540,7 @@
 
     rl.rlim_cur = x;
     rl.rlim_max = x;
-    if (setrlimit(RLIMIT_NUMFDS, &rl) < 0) {
+    if (setrlimit(RLIMIT_NUMFDS, &rl) < 0 && x != RLIM_INFINITY) {
 	syslog(LOG_ERR, "setrlimit: Unable to set file descriptors limit to %ld: %m", x);
 
 #ifdef HAVE_GETRLIMIT
@@ -1517,11 +1555,9 @@
     }
 
 
-    if (verbose > 1) {
-	r = getrlimit(RLIMIT_NUMFDS, &rl);
-	syslog(LOG_DEBUG, "set maximum file descriptors to %ld/%ld", rl.rlim_cur,
-	       rl.rlim_max);
-    }
+    if (verbose > 1 && getrlimit(RLIMIT_NUMFDS, &rl) >=0)
+	syslog(LOG_DEBUG, "set maximum file descriptors to %ld/%ld",
+		rl.rlim_cur, rl.rlim_max);
 #else
     }
 #endif /* HAVE_GETRLIMIT */
@@ -1540,7 +1576,10 @@
 
     /* disable all services -
        they will be re-enabled if they appear in config file */
-    for (i = 0; i < nservices; i++) Services[i].exec = NULL;
+    for (i = 0; i < nservices; i++) {
+	if (Services[i].exec) free((void*)Services[i].exec);
+	Services[i].exec = NULL;
+    }
 
     /* read services */
     masterconf_getsection("SERVICES", &add_service, (void*) 1);
@@ -1555,13 +1594,18 @@
 		       Services[i].stat[0], Services[i].stat[1]);
 
 	    /* Only free the service info on the primary */
-	    if(Services[i].associate == 0) {
+	    if (Services[i].associate == 0) {
+		free(Services[i].name);
 		free(Services[i].listen);
 		free(Services[i].proto);
 	    }
+	    Services[i].name = NULL;
 	    Services[i].listen = NULL;
 	    Services[i].proto = NULL;
 	    Services[i].desired_workers = 0;
+	    Services[i].nforks = 0;
+	    Services[i].nactive = 0;
+	    Services[i].nconnections = 0;
 
 	    /* send SIGHUP to all children */
 	    for (j = 0 ; j < child_table_size ; j++ ) {
@@ -1644,9 +1688,9 @@
     p = getenv("CYRUS_VERBOSE");
     if (p) verbose = atoi(p) + 1;
 #ifdef HAVE_NETSNMP
-    while ((opt = getopt(argc, argv, "C:M:p:l:Ddj:P:x:")) != EOF) {
+    while ((opt = getopt(argc, argv, "C:M:p:l:DdjJ:P:x:")) != EOF) {
 #else
-    while ((opt = getopt(argc, argv, "C:M:p:l:Ddj:")) != EOF) {
+    while ((opt = getopt(argc, argv, "C:M:p:l:DdjJ:")) != EOF) {
 #endif
 	switch (opt) {
 	case 'C': /* alt imapd.conf file */
@@ -1679,8 +1723,15 @@
 	    /* Janitor frequency */
 	    janitor_frequency = atoi(optarg);
 	    if(janitor_frequency < 1)
-		fatal("The janitor period must be at least 1 second", EX_CONFIG);
+		fatal("The janitor frequency must be at least once per second", EX_CONFIG);
 	    break;   
+       case 'J':
+           /* Janitor delay before cleanup of a child */
+           child_mourning_time = atoi(optarg);
+           if(child_mourning_time < 1)
+               fatal("The janitor's mourning time interval must be at least 1 second",
+                       EX_CONFIG);
+           break;
 #ifdef HAVE_NETSNMP
 	case 'P': /* snmp AgentXPingInterval */
 	    agentxpinginterval = atoi(optarg);
@@ -1837,7 +1888,7 @@
 	    }
 	    
 	    /* Write PID */
-	    snprintf(buf, sizeof(buf), "%lu\n", (unsigned long int)getpid());
+	    snprintf(buf, sizeof(buf), "%lu\n", (unsigned long int) getpid());
 	    if(lseek(pidfd, 0, SEEK_SET) == -1 ||
 	       ftruncate(pidfd, 0) == -1 ||
 	       write(pidfd, buf, strlen(buf)) == -1) {
@@ -2056,13 +2107,19 @@
 	    int j;
 
 	    if (FD_ISSET(x, &rfds)) {
-		r = read(x, &msg, sizeof(msg));
-		if (r != sizeof(msg)) {
-		    syslog(LOG_ERR, "got incorrectly sized response from child: %x", i);
+		while ((r = read_msg(x, &msg)) == 0)
+		    process_msg(i, &msg);
+	
+		if (r == 2) {
+		    syslog(LOG_ERR,
+			"got incorrectly sized response from child: %x", i);
 		    continue;
 		}
-		
-		process_msg(i, &msg);
+		if (r < 0) {
+		    syslog(LOG_ERR,
+			"error while receiving message from child %x: %m", i);
+		    continue;
+		}
 	    }
 
 	    if (Services[i].exec &&

Modified: branches/idled/master/master.h
URL: https://mail.incase.de/viewcvs/branches/idled/master/master.h?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/master/master.h (original)
+++ branches/idled/master/master.h Sat May  6 14:53:33 2006
@@ -43,6 +43,7 @@
 extern struct service *Services;
 extern int allocservices;
 extern int nservices;
+void sighandler_setup(void);
 
 /*
  * Description of multiple address family support from

Modified: branches/idled/master/masterconf.c
URL: https://mail.incase.de/viewcvs/branches/idled/master/masterconf.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/master/masterconf.c (original)
+++ branches/idled/master/masterconf.c Sat May  6 14:53:33 2006
@@ -133,7 +133,7 @@
 	} else {
 	    /* one word */
 	    for (i = 0; i < 255; i++) {
-		if (isspace((int) *p)) break;
+		if ((!*p) || (isspace((int) *p))) break;
 		v[i] = *p++;
 	    }
 	}
@@ -150,8 +150,13 @@
     const char *val = masterconf_getstring(e, key, NULL);
 
     if (!val) return def;
-    if (!isdigit((int) *val) && 
-	(*val != '-' || !isdigit((int) val[1]))) return def;
+    if (!isdigit((int) *val) &&
+        (*val != '-' || !isdigit((int) val[1]))) {
+	syslog(LOG_DEBUG, "value '%s' for '%s' does not look like a number.",
+	     val, key);
+      return def;
+    }
+
     return atoi(val);
 }
 
@@ -169,6 +174,10 @@
 	     (val[0] == 'o' && val[1] == 'n') || val[0] == 't') {
 	return 1;
     }
+
+    syslog(LOG_DEBUG, "cannot interpret value '%s' for key '%s'. use y/n.",
+	   val, key);
+
     return def;
 }
 

Modified: branches/idled/notifyd/Makefile.in
URL: https://mail.incase.de/viewcvs/branches/idled/notifyd/Makefile.in?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/notifyd/Makefile.in (original)
+++ branches/idled/notifyd/Makefile.in Sat May  6 14:53:33 2006
@@ -54,7 +54,7 @@
 
 DEFS = @DEFS@ @LOCALDEFS@
 CPPFLAGS = -I.. -I$(srcdir)/../sieve -I$(srcdir)/../imap -I$(srcdir)/../lib @COM_ERR_CPPFLAGS@ @CPPFLAGS@ @SASLFLAGS@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ @WARNERROR@
 LDFLAGS = @LDFLAGS@
 
 prefix = @prefix@

Modified: branches/idled/notifyd/notifyd.c
URL: https://mail.incase.de/viewcvs/branches/idled/notifyd/notifyd.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/notifyd/notifyd.c (original)
+++ branches/idled/notifyd/notifyd.c Sat May  6 14:53:33 2006
@@ -143,7 +143,7 @@
 	if (cp) nopt = strtol(cp, NULL, 10);
 	if (nopt < 0 || errno == ERANGE) cp = NULL;
 
-	if (cp && nopt &&
+	if (cp && (nopt > 0) &&
 	    !(options = (char**) xrealloc(options, nopt * sizeof(char*)))) {
 	    fatal("xmalloc(): can't allocate options", EC_OSERR);
 	}

Modified: branches/idled/perl/Makefile.in
URL: https://mail.incase.de/viewcvs/branches/idled/perl/Makefile.in?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/perl/Makefile.in (original)
+++ branches/idled/perl/Makefile.in Sat May  6 14:53:33 2006
@@ -82,9 +82,9 @@
 			   BDB_LIB="$(BDB_LIB)" BDB_INC="$(BDB_INC)" \
 			   OPENSSL_LIB="$(OPENSSL_LIB)" OPENSSL_INC="$(OPENSSL_INC)" \
 			   SASL_LIB="$(SASL_LIB)" SASL_INC="$(SASL_INC)" CC="$(CC)" \
-			     $(PERL) Makefile.PL PREFIX=$(prefix); \
+			     $(PERL) Makefile.PL INSTALLDIRS=vendor; \
 			fi; \
-			$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) all) || exit 1; \
+			$(MAKE) $(MFLAGS) LD_RUN_PATH= DESTDIR=$(DESTDIR) all) || exit 1; \
 	done
 
 install::

Modified: branches/idled/perl/sieve/Makefile.in
URL: https://mail.incase.de/viewcvs/branches/idled/perl/sieve/Makefile.in?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/perl/sieve/Makefile.in (original)
+++ branches/idled/perl/sieve/Makefile.in Sat May  6 14:53:33 2006
@@ -84,9 +84,9 @@
 			   BDB_LIB="$(BDB_LIB)" BDB_INC="$(BDB_INC)" \
 			   OPENSSL_LIB="$(OPENSSL_LIB)" OPENSSL_INC="$(OPENSSL_INC)" \
 			   SASL_LIB="$(SASL_LIB)" SASL_INC="$(SASL_INC)" CC="$(CC)" \
-			     $(PERL) Makefile.PL PREFIX=$(prefix); \
+			     $(PERL) Makefile.PL INSTALLDIRS=vendor; \
 			fi; \
-			$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) all) || exit 1; \
+			$(MAKE) $(MFLAGS) LD_RUN_PATH= DESTDIR=$(DESTDIR) all) || exit 1; \
 	done
 
 install::

Modified: branches/idled/perl/sieve/lib/Makefile.in
URL: https://mail.incase.de/viewcvs/branches/idled/perl/sieve/lib/Makefile.in?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/perl/sieve/lib/Makefile.in (original)
+++ branches/idled/perl/sieve/lib/Makefile.in Sat May  6 14:53:33 2006
@@ -57,7 +57,7 @@
 DEPLIBS = ../../../lib/libcyrus.a ../../../lib/libcyrus_min.a @DEPLIBS@
 
 MAKEDEPEND_CFLAGS = @CFLAGS@
-CFLAGS = @CFLAGS@ @PERL_CCCDLFLAGS@
+CFLAGS = @CFLAGS@ @PERL_CCCDLFLAGS@ -fPIC
 LDFLAGS = @LDFLAGS@
 
 SHELL = /bin/sh

Modified: branches/idled/ptclient/ptexpire.c
URL: https://mail.incase.de/viewcvs/branches/idled/ptclient/ptexpire.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/ptclient/ptexpire.c (original)
+++ branches/idled/ptclient/ptexpire.c Sat May  6 14:53:33 2006
@@ -114,7 +114,7 @@
 
     if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
     
-    openlog("ptexpire", LOG_PID, SYSLOG_FACILITY);
+    openlog("cyrus/ptexpire", LOG_PID, SYSLOG_FACILITY);
 
     while ((opt = getopt(argc, argv, "C:E:")) != EOF) {
 	switch (opt) {

Modified: branches/idled/ptclient/test.c
URL: https://mail.incase.de/viewcvs/branches/idled/ptclient/test.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/ptclient/test.c (original)
+++ branches/idled/ptclient/test.c Sat May  6 14:53:33 2006
@@ -57,7 +57,7 @@
     cacheid=cache;
   } else
     cacheid=NULL;
-  openlog("pttest", LOG_PID, SYSLOG_FACILITY);  
+  openlog("cyrus/pttest", LOG_PID, SYSLOG_FACILITY);  
   
   if (!auth_setid(argv[1],cacheid))
     printf ("Auth_memberof(%s,%s) is %d\n", argv[1], argv[2],

Modified: branches/idled/ptclient/test2.c
URL: https://mail.incase.de/viewcvs/branches/idled/ptclient/test2.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/ptclient/test2.c (original)
+++ branches/idled/ptclient/test2.c Sat May  6 14:53:33 2006
@@ -46,7 +46,7 @@
 
 int main(void) {
   char cacheid[16]="4224423";
-  openlog("testr", LOG_PID, SYSLOG_FACILITY);
+  openlog("cyrus/testr", LOG_PID, SYSLOG_FACILITY);
   
   if (!auth_setid("cg2v at club.cc.cmu.edu",cacheid))
     printf ("Auth_memberof(cg2v,cg2v:me) is %d\n",

Modified: branches/idled/sieve/Makefile.in
URL: https://mail.incase.de/viewcvs/branches/idled/sieve/Makefile.in?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/sieve/Makefile.in (original)
+++ branches/idled/sieve/Makefile.in Sat May  6 14:53:33 2006
@@ -40,7 +40,7 @@
 DEFS = @DEFS@
 CPPFLAGS = -I.. -I$(srcdir)/../lib @COM_ERR_CPPFLAGS@ @CPPFLAGS@ @SASLFLAGS@
 MAKEDEPEND_CFLAGS = @CFLAGS@
-CFLAGS = @CFLAGS@ @PERL_CCCDLFLAGS@
+CFLAGS = @CFLAGS@ @PERL_CCCDLFLAGS@ -fPIC
 LDFLAGS = @LDFLAGS@
 
 MAKEDEPEND = @MAKEDEPEND@
@@ -51,6 +51,7 @@
 LIBS = libsieve.a $(IMAP_LIBS) $(IMAP_COM_ERR_LIBS)
 DEPLIBS=../lib/libcyrus.a ../lib/libcyrus_min.a @DEPLIBS@
 
+BINARIES = sievec sieved
 BUILT_SOURCES = addr.c addr.h addr-lex.c \
 	sieve.c sieve.h sieve-lex.c \
 	sieve_err.h sieve_err.c
@@ -114,7 +115,7 @@
 	$(COMPILE_ET) $(srcdir)/sieve_err.et
 
 clean:
-	rm -f test *~ *.o *.a Makefile.bak makedepend.log
+	rm -f test *~ *.o *.a Makefile.bak makedepend.log $(BINARIES)
 
 distclean: clean
 	rm -f Makefile

Modified: branches/idled/sieve/md5.c
URL: https://mail.incase.de/viewcvs/branches/idled/sieve/md5.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/sieve/md5.c (original)
+++ branches/idled/sieve/md5.c Sat May  6 14:53:33 2006
@@ -31,7 +31,7 @@
 
 #include "md5global.h"
 #include "md5.h"
-#include "hmac-md5.h"
+#include "sasl/hmac-md5.h"
 
 /* Constants for MD5Transform routine.
 */

Modified: branches/idled/timsieved/Makefile.in
URL: https://mail.incase.de/viewcvs/branches/idled/timsieved/Makefile.in?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/timsieved/Makefile.in (original)
+++ branches/idled/timsieved/Makefile.in Sat May  6 14:53:33 2006
@@ -54,7 +54,7 @@
 
 DEFS = @DEFS@ @LOCALDEFS@
 CPPFLAGS = -I.. -I$(srcdir)/../sieve -I$(srcdir)/../imap -I$(srcdir)/../lib @COM_ERR_CPPFLAGS@ @CPPFLAGS@ @SASLFLAGS@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ @WARNERROR@
 LDFLAGS = @LDFLAGS@
 
 prefix = @prefix@

Modified: branches/idled/timsieved/actions.c
URL: https://mail.incase.de/viewcvs/branches/idled/timsieved/actions.c?rev=418&root=cyrus22&r1=417&r2=418&view=diff
==============================================================================
--- branches/idled/timsieved/actions.c (original)
+++ branches/idled/timsieved/actions.c Sat May  6 14:53:33 2006
@@ -364,7 +364,8 @@
 
   if (result != TIMSIEVE_OK) {
       if (errstr && *errstr) { 
-	  prot_printf(conn, "NO {%d}\r\n%s\r\n", strlen(errstr), errstr);
+	  prot_printf(conn, "NO {%lu}\r\n%s\r\n",
+			  (unsigned long) strlen(errstr), errstr);
 	  free(errstr);
       } else {
 	  if (errstr) free(errstr);




More information about the Pkg-Cyrus-imapd-Debian-devel mailing list