[Pkg-Cyrus-imapd-Debian-devel] [SVN] r173 - in trunk/cyrus-imapd-2.2.12: ./ cmulocal/ debian/patches/ doc/ imap/ imtest/ installsieve/ lib/ man/ master/ notifyd/ perl/ perl/imap/IMAP/ perl/sieve/ perl/sieve/lib/ ptclient/ sieve/ timsieved/

debian at incase.de debian at incase.de
Fri Nov 11 16:15:48 UTC 2005


Author: sven
Date: Fri Nov 11 17:15:40 2005
New Revision: 173

URL: https://mail.incase.de/viewcvs?root=cyrus22?view=rev&rev=173
Log:
move all remaining patches to dpatch, .diff.gz should now only contain files in debian/
Added:
    trunk/cyrus-imapd-2.2.12/debian/patches/01-fix_Makefile.in.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/02-add_mkinstalldirs.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/03-fix_docs.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/04-add_autogen.sh.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/05-fix_programnames.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/06-disable_runpath.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/07-update_aclocal_and_configure.in.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/08-clean_socket_closes.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/09-kerberos-ipv4-ipv6-kludge-removal.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/10-fix_potential_overflows.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/11-fix_syslog_prefix.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/12-fix_timeout_handling.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/13-master_process_handling.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/14-xmalloc.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/15-munge_8bit.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/16-fix_mib.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/17-fix_tail_syntax_in_xversion.h.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/18-fix_strlen_return_type.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/19-fix_tls_ssl.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/21-fix_config-parsing.dpatch   (with props)
    trunk/cyrus-imapd-2.2.12/debian/patches/22-imapd_index_check.dpatch   (with props)
Removed:
    trunk/cyrus-imapd-2.2.12/autogen.sh
    trunk/cyrus-imapd-2.2.12/mkinstalldirs
Modified:
    trunk/cyrus-imapd-2.2.12/Makefile.in
    trunk/cyrus-imapd-2.2.12/aclocal.m4
    trunk/cyrus-imapd-2.2.12/cmulocal/cyrus.m4
    trunk/cyrus-imapd-2.2.12/configure.in
    trunk/cyrus-imapd-2.2.12/debian/patches/00list
    trunk/cyrus-imapd-2.2.12/debian/patches/25_update_install-sh.dpatch
    trunk/cyrus-imapd-2.2.12/debian/patches/40_rehash_fix_pathes.dpatch
    trunk/cyrus-imapd-2.2.12/debian/patches/45-kolab2-annotations.dpatch
    trunk/cyrus-imapd-2.2.12/debian/patches/60-lower-poptimeout-minimum.dpatch
    trunk/cyrus-imapd-2.2.12/debian/patches/65-sieveshell-enhancements.dpatch
    trunk/cyrus-imapd-2.2.12/debian/patches/99-update-autoconf.dpatch
    trunk/cyrus-imapd-2.2.12/doc/faq.html
    trunk/cyrus-imapd-2.2.12/doc/install-virtdomains.html
    trunk/cyrus-imapd-2.2.12/imap/Makefile.in
    trunk/cyrus-imapd-2.2.12/imap/backend.c
    trunk/cyrus-imapd-2.2.12/imap/ctl_mboxlist.c
    trunk/cyrus-imapd-2.2.12/imap/deliver.c
    trunk/cyrus-imapd-2.2.12/imap/fud.c
    trunk/cyrus-imapd-2.2.12/imap/global.c
    trunk/cyrus-imapd-2.2.12/imap/idle_idled.c
    trunk/cyrus-imapd-2.2.12/imap/imapd.c
    trunk/cyrus-imapd-2.2.12/imap/index.c
    trunk/cyrus-imapd-2.2.12/imap/lmtpd.c
    trunk/cyrus-imapd-2.2.12/imap/mbdump.c
    trunk/cyrus-imapd-2.2.12/imap/mboxlist.h
    trunk/cyrus-imapd-2.2.12/imap/message.c
    trunk/cyrus-imapd-2.2.12/imap/mupdate-client.c
    trunk/cyrus-imapd-2.2.12/imap/mupdate.c
    trunk/cyrus-imapd-2.2.12/imap/mupdate.h
    trunk/cyrus-imapd-2.2.12/imap/pop3d.c
    trunk/cyrus-imapd-2.2.12/imap/proxyd.c
    trunk/cyrus-imapd-2.2.12/imap/quota.c
    trunk/cyrus-imapd-2.2.12/imap/reconstruct.c
    trunk/cyrus-imapd-2.2.12/imap/signals.c
    trunk/cyrus-imapd-2.2.12/imap/spool.c
    trunk/cyrus-imapd-2.2.12/imap/tls.c
    trunk/cyrus-imapd-2.2.12/imap/xversion.sh
    trunk/cyrus-imapd-2.2.12/imtest/imtest.c
    trunk/cyrus-imapd-2.2.12/installsieve/Makefile.in
    trunk/cyrus-imapd-2.2.12/lib/Makefile.in
    trunk/cyrus-imapd-2.2.12/lib/imapoptions
    trunk/cyrus-imapd-2.2.12/lib/imclient.c
    trunk/cyrus-imapd-2.2.12/lib/lock.h
    trunk/cyrus-imapd-2.2.12/lib/lock_fcntl.c
    trunk/cyrus-imapd-2.2.12/lib/lock_flock.c
    trunk/cyrus-imapd-2.2.12/lib/map_stupidshared.c
    trunk/cyrus-imapd-2.2.12/lib/xmalloc.h
    trunk/cyrus-imapd-2.2.12/man/chk_cyrus.8
    trunk/cyrus-imapd-2.2.12/man/ctl_cyrusdb.8
    trunk/cyrus-imapd-2.2.12/man/ctl_deliver.8
    trunk/cyrus-imapd-2.2.12/man/ctl_mboxlist.8
    trunk/cyrus-imapd-2.2.12/man/cyr_expire.8
    trunk/cyrus-imapd-2.2.12/man/cyrus.conf.5
    trunk/cyrus-imapd-2.2.12/man/deliver.8
    trunk/cyrus-imapd-2.2.12/man/fud.8
    trunk/cyrus-imapd-2.2.12/man/idled.8
    trunk/cyrus-imapd-2.2.12/man/imapd.8
    trunk/cyrus-imapd-2.2.12/man/lmtpd.8
    trunk/cyrus-imapd-2.2.12/man/master.8
    trunk/cyrus-imapd-2.2.12/man/nntpd.8
    trunk/cyrus-imapd-2.2.12/man/notifyd.8
    trunk/cyrus-imapd-2.2.12/man/pop3d.8
    trunk/cyrus-imapd-2.2.12/man/quota.8
    trunk/cyrus-imapd-2.2.12/man/reconstruct.8
    trunk/cyrus-imapd-2.2.12/man/smmapd.8
    trunk/cyrus-imapd-2.2.12/man/timsieved.8
    trunk/cyrus-imapd-2.2.12/man/tls_prune.8
    trunk/cyrus-imapd-2.2.12/master/CYRUS-MASTER.mib
    trunk/cyrus-imapd-2.2.12/master/Makefile.in
    trunk/cyrus-imapd-2.2.12/master/master.c
    trunk/cyrus-imapd-2.2.12/master/master.h
    trunk/cyrus-imapd-2.2.12/master/masterconf.c
    trunk/cyrus-imapd-2.2.12/master/service.c
    trunk/cyrus-imapd-2.2.12/notifyd/Makefile.in
    trunk/cyrus-imapd-2.2.12/notifyd/notify_log.c
    trunk/cyrus-imapd-2.2.12/notifyd/notifyd.c
    trunk/cyrus-imapd-2.2.12/perl/Makefile.in
    trunk/cyrus-imapd-2.2.12/perl/imap/IMAP/Shell.pm
    trunk/cyrus-imapd-2.2.12/perl/sieve/Makefile.in
    trunk/cyrus-imapd-2.2.12/perl/sieve/lib/Makefile.in
    trunk/cyrus-imapd-2.2.12/perl/sieve/lib/request.c
    trunk/cyrus-imapd-2.2.12/ptclient/ptexpire.c
    trunk/cyrus-imapd-2.2.12/ptclient/test.c
    trunk/cyrus-imapd-2.2.12/ptclient/test2.c
    trunk/cyrus-imapd-2.2.12/sieve/Makefile.in
    trunk/cyrus-imapd-2.2.12/sieve/md5.c
    trunk/cyrus-imapd-2.2.12/timsieved/Makefile.in
    trunk/cyrus-imapd-2.2.12/timsieved/actions.c

Modified: trunk/cyrus-imapd-2.2.12/Makefile.in
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/Makefile.in?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/Makefile.in&r1=172&p2=trunk/cyrus-imapd-2.2.12/Makefile.in&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/Makefile.in (original)
+++ trunk/cyrus-imapd-2.2.12/Makefile.in Fri Nov 11 17:15:40 2005
@@ -41,7 +41,7 @@
 # 
 
 SUBDIRS = man @PRE_SUBDIRS@ lib @SIEVE_SUBDIRS@ @SERVER_SUBDIRS@ \
-	imtest perl @SNMP_SUBDIRS@ @EXTRA_SUBDIRS@
+	imtest @SNMP_SUBDIRS@ @EXTRA_SUBDIRS@
 DISTSUBDIRS = doc
 
 srcdir = @srcdir@

Modified: trunk/cyrus-imapd-2.2.12/aclocal.m4
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/aclocal.m4?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/aclocal.m4&r1=172&p2=trunk/cyrus-imapd-2.2.12/aclocal.m4&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/aclocal.m4 (original)
+++ trunk/cyrus-imapd-2.2.12/aclocal.m4 Fri Nov 11 17:15:40 2005
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005  Free Software Foundation, Inc.
+# generated automatically by aclocal 1.7.2 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -11,12 +11,1850 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
-m4_include([cmulocal/berkdb.m4])
-m4_include([cmulocal/bsd_sockets.m4])
-m4_include([cmulocal/c-attribute.m4])
-m4_include([cmulocal/c-fpic.m4])
-m4_include([cmulocal/cyrus.m4])
-m4_include([cmulocal/ipv6.m4])
-m4_include([cmulocal/libwrap.m4])
-m4_include([cmulocal/sasl2.m4])
-m4_include([cmulocal/ucdsnmp.m4])
+# isc-posix.m4 serial 2 (gettext-0.11.2)
+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
+
+# This test replaces the one in autoconf.
+# Currently this macro should have the same name as the autoconf macro
+# because gettext's gettext.m4 (distributed in the automake package)
+# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
+# give these diagnostics:
+#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
+#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
+
+undefine([AC_ISC_POSIX])
+
+AC_DEFUN([AC_ISC_POSIX],
+  [
+    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
+    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
+  ]
+)
+
+dnl
+dnl $Id: c-attribute.m4,v 1.3 2003/10/08 20:35:24 rjs3 Exp $
+dnl
+
+dnl
+dnl Test for __attribute__
+dnl
+
+AC_DEFUN([CMU_C___ATTRIBUTE__], [
+AC_MSG_CHECKING(for __attribute__)
+AC_CACHE_VAL(ac_cv___attribute__, [
+AC_TRY_COMPILE([
+#include <stdlib.h>
+],
+[
+static void foo(void) __attribute__ ((noreturn));
+
+static void
+foo(void)
+{
+  exit(1);
+}
+],
+ac_cv___attribute__=yes,
+ac_cv___attribute__=no)])
+if test "$ac_cv___attribute__" = "yes"; then
+  AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
+fi
+AC_MSG_RESULT($ac_cv___attribute__)
+])
+
+
+dnl
+dnl $Id: c-fpic.m4,v 1.2 2003/10/08 20:35:24 rjs3 Exp $
+dnl
+
+dnl
+dnl Test for -fPIC
+dnl
+
+AC_DEFUN([CMU_C_FPIC], [
+AC_MSG_CHECKING(if compiler supports -fPIC)
+AC_CACHE_VAL(ac_cv_fpic, [
+save_CFLAGS=$CFLAGS
+CFLAGS="${CFLAGS} -fPIC"
+AC_TRY_COMPILE([
+#include <stdlib.h>
+],
+[
+static void
+foo(void)
+{
+  exit(1);
+}
+],
+ac_cv_fpic=yes,
+ac_cv_fpic=no)
+CFLAGS=$save_CFLAGS
+])
+if test "$ac_cv_fpic" = "yes"; then
+    FPIC_CFLAGS="-fPIC"
+else
+    FPIC_CFLAGS=""
+fi
+AC_MSG_RESULT($ac_cv_fpic)
+])
+
+
+dnl
+dnl Additional macros for configure.in packaged up for easier theft.
+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 It would be good if ANDREW_ADD_LIBPATH could detect if something was
+dnl already there and not redundantly add it if it is.
+
+dnl add -L(arg), and possibly (runpath switch)(arg), to LDFLAGS
+dnl (so the runpath for shared libraries is set).
+AC_DEFUN([CMU_ADD_LIBPATH], [
+  # this is CMU ADD LIBPATH
+  if test "$andrew_runpath_switch" = "none" ; then
+	LDFLAGS="-L$1 ${LDFLAGS}"
+  else
+	LDFLAGS="-L$1 $andrew_runpath_switch$1 ${LDFLAGS}"
+  fi
+])
+
+dnl add -L(1st arg), and possibly (runpath switch)(1st arg), to (2nd arg)
+dnl (so the runpath for shared libraries is set).
+AC_DEFUN([CMU_ADD_LIBPATH_TO], [
+  # this is CMU ADD LIBPATH TO
+  if test "$andrew_runpath_switch" = "none" ; then
+	$2="-L$1 ${$2}"
+  else
+	$2="-L$1 ${$2} $andrew_runpath_switch$1"
+  fi
+])
+
+dnl runpath initialization
+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}"
+  ])])
+
+dnl bsd_sockets.m4--which socket libraries do we need? 
+dnl Derrick Brashear
+dnl from Zephyr
+dnl $Id: bsd_sockets.m4,v 1.9 2003/10/08 20:35:24 rjs3 Exp $
+
+dnl Hacked on by Rob Earhart to not just toss stuff in LIBS
+dnl It now puts everything required for sockets into LIB_SOCKET
+
+AC_DEFUN([CMU_SOCKETS], [
+	save_LIBS="$LIBS"
+	LIB_SOCKET=""
+	AC_CHECK_FUNC(connect, :,
+		AC_CHECK_LIB(nsl, gethostbyname,
+			     LIB_SOCKET="-lnsl $LIB_SOCKET")
+		AC_CHECK_LIB(socket, connect,
+			     LIB_SOCKET="-lsocket $LIB_SOCKET")
+	)
+	LIBS="$LIB_SOCKET $save_LIBS"
+	AC_CHECK_FUNC(res_search, :,
+                AC_CHECK_LIB(resolv, res_search,
+                              LIB_SOCKET="-lresolv $LIB_SOCKET") 
+        )
+	LIBS="$LIB_SOCKET $save_LIBS"
+	AC_CHECK_FUNCS(dn_expand dns_lookup)
+	LIBS="$save_LIBS"
+	AC_SUBST(LIB_SOCKET)
+	])
+
+dnl See whether we can use IPv6 related functions
+dnl contributed by Hajimu UMEMOTO
+
+AC_DEFUN([IPv6_CHECK_FUNC], [
+AC_CHECK_FUNC($1, [dnl
+  ac_cv_lib_socket_$1=no
+  ac_cv_lib_inet6_$1=no
+], [dnl
+  AC_CHECK_LIB(socket, $1, [dnl
+    LIBS="$LIBS -lsocket"
+    ac_cv_lib_inet6_$1=no
+  ], [dnl
+    AC_MSG_CHECKING([whether your system has IPv6 directory])
+    AC_CACHE_VAL(ipv6_cv_dir, [dnl
+      for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
+	if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then
+	  break
+	fi
+      done])dnl
+    AC_MSG_RESULT($ipv6_cv_dir)
+    if test $ipv6_cv_dir = no; then
+      ac_cv_lib_inet6_$1=no
+    else
+      if test x$ipv6_libinet6 = x; then
+	ipv6_libinet6=no
+	SAVELDFLAGS="$LDFLAGS"
+	LDFLAGS="$LDFLAGS -L$ipv6_cv_dir/lib"
+      fi
+      AC_CHECK_LIB(inet6, $1, [dnl
+	if test $ipv6_libinet6 = no; then
+	  ipv6_libinet6=yes
+	  LIBS="$LIBS -linet6"
+	fi],)dnl
+      if test $ipv6_libinet6 = no; then
+	LDFLAGS="$SAVELDFLAGS"
+      fi
+    fi])dnl
+])dnl
+ipv6_cv_$1=no
+if test $ac_cv_func_$1 = yes -o $ac_cv_lib_socket_$1 = yes \
+     -o $ac_cv_lib_inet6_$1 = yes
+then
+  ipv6_cv_$1=yes
+fi
+if test $ipv6_cv_$1 = no; then
+  if test $1 = getaddrinfo; then
+    for ipv6_cv_pfx in o n; do
+      AC_EGREP_HEADER(${ipv6_cv_pfx}$1, netdb.h,
+		      [AC_CHECK_FUNC(${ipv6_cv_pfx}$1)])
+      if eval test X\$ac_cv_func_${ipv6_cv_pfx}$1 = Xyes; then
+        AC_DEFINE(HAVE_GETADDRINFO,[],[Do we have a getaddrinfo?])
+        ipv6_cv_$1=yes
+        break
+      fi
+    done
+  fi
+fi
+if test $ipv6_cv_$1 = yes; then
+  ifelse([$2], , :, [$2])
+else
+  ifelse([$3], , :, [$3])
+fi])
+
+
+dnl See whether we have ss_family in sockaddr_storage
+AC_DEFUN([IPv6_CHECK_SS_FAMILY], [
+AC_MSG_CHECKING([whether you have ss_family in struct sockaddr_storage])
+AC_CACHE_VAL(ipv6_cv_ss_family, [dnl
+AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/socket.h>],
+	[struct sockaddr_storage ss; int i = ss.ss_family;],
+	[ipv6_cv_ss_family=yes], [ipv6_cv_ss_family=no])])dnl
+if test $ipv6_cv_ss_family = yes; then
+  ifelse([$1], , AC_DEFINE(HAVE_SS_FAMILY,[],[Is there an ss_family in sockaddr_storage?]), [$1])
+else
+  ifelse([$2], , :, [$2])
+fi
+AC_MSG_RESULT($ipv6_cv_ss_family)])
+
+
+dnl whether you have sa_len in struct sockaddr
+AC_DEFUN([IPv6_CHECK_SA_LEN], [
+AC_MSG_CHECKING([whether you have sa_len in struct sockaddr])
+AC_CACHE_VAL(ipv6_cv_sa_len, [dnl
+AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/socket.h>],
+	       [struct sockaddr sa; int i = sa.sa_len;],
+	       [ipv6_cv_sa_len=yes], [ipv6_cv_sa_len=no])])dnl
+if test $ipv6_cv_sa_len = yes; then
+  ifelse([$1], , AC_DEFINE(HAVE_SOCKADDR_SA_LEN,[],[Does sockaddr have an sa_len?]), [$1])
+else
+  ifelse([$2], , :, [$2])
+fi
+AC_MSG_RESULT($ipv6_cv_sa_len)])
+
+
+dnl See whether sys/socket.h has socklen_t
+AC_DEFUN([IPv6_CHECK_SOCKLEN_T], [
+AC_MSG_CHECKING(for socklen_t)
+AC_CACHE_VAL(ipv6_cv_socklen_t, [dnl
+AC_TRY_LINK([#include <sys/types.h>
+#include <sys/socket.h>],
+	    [socklen_t len = 0;],
+	    [ipv6_cv_socklen_t=yes], [ipv6_cv_socklen_t=no])])dnl
+if test $ipv6_cv_socklen_t = yes; then
+  ifelse([$1], , AC_DEFINE(HAVE_SOCKLEN_T,[],[Do we have a socklen_t?]), [$1])
+else
+  ifelse([$2], , :, [$2])
+fi
+AC_MSG_RESULT($ipv6_cv_socklen_t)])
+
+
+dnl $Id: berkdb.m4,v 1.19 2005/01/06 20:24:52 shadow Exp $
+
+AC_DEFUN([CMU_DB_INC_WHERE1], [
+saved_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$saved_CPPFLAGS -I$1"
+AC_TRY_COMPILE([#include <db.h>],
+[DB *db;
+db_create(&db, NULL, 0);
+db->open(db, "foo.db", NULL, DB_UNKNOWN, DB_RDONLY, 0644);],
+ac_cv_found_db_inc=yes,
+ac_cv_found_db_inc=no)
+CPPFLAGS=$saved_CPPFLAGS
+])
+
+AC_DEFUN([CMU_DB_INC_WHERE], [
+   for i in $1; do
+      AC_MSG_CHECKING(for db headers in $i)
+      CMU_DB_INC_WHERE1($i)
+      CMU_TEST_INCPATH($i, db)
+      if test "$ac_cv_found_db_inc" = "yes"; then
+        ac_cv_db_where_inc=$i
+        AC_MSG_RESULT(found)
+        break
+      else
+        AC_MSG_RESULT(not found)
+      fi
+    done
+])
+
+#
+# Test for lib files
+#
+
+AC_DEFUN([CMU_DB3_LIB_WHERE1], [
+AC_REQUIRE([CMU_AFS])
+AC_REQUIRE([CMU_KRB4])
+saved_LIBS=$LIBS
+  LIBS="$saved_LIBS -L$1 -ldb-3"
+AC_TRY_LINK([#include <db.h>],
+[db_env_create(NULL, 0);],
+[ac_cv_found_db_3_lib=yes],
+ac_cv_found_db_3_lib=no)
+LIBS=$saved_LIBS
+])
+AC_DEFUN([CMU_DB4_LIB_WHERE1], [
+AC_REQUIRE([CMU_AFS])
+AC_REQUIRE([CMU_KRB4])
+saved_LIBS=$LIBS
+LIBS="$saved_LIBS -L$1 -ldb-4"
+AC_TRY_LINK([#include <db.h>],
+[db_env_create(NULL, 0);],
+[ac_cv_found_db_4_lib=yes],
+ac_cv_found_db_4_lib=no)
+LIBS=$saved_LIBS
+])
+
+AC_DEFUN([CMU_DB_LIB_WHERE], [
+   for i in $1; do
+      AC_MSG_CHECKING(for db libraries in $i)
+if test "$enable_db4" = "yes"; then
+      CMU_DB4_LIB_WHERE1($i)
+      CMU_TEST_LIBPATH($i, [db-4])
+      ac_cv_found_db_lib=$ac_cv_found_db_4_lib
+else
+      CMU_DB3_LIB_WHERE1($i)
+      CMU_TEST_LIBPATH($i, [db-3])
+      ac_cv_found_db_lib=$ac_cv_found_db_3_lib
+fi
+      if test "$ac_cv_found_db_lib" = "yes" ; then
+        ac_cv_db_where_lib=$i
+        AC_MSG_RESULT(found)
+        break
+      else
+        AC_MSG_RESULT(not found)
+      fi
+    done
+])
+
+AC_DEFUN([CMU_USE_DB], [
+AC_ARG_WITH(db,
+	[  --with-db=PREFIX      Compile with db support],
+	[if test "X$with_db" = "X"; then
+		with_db=yes
+	fi])
+AC_ARG_WITH(db-lib,
+	[  --with-db-lib=dir     use db libraries in dir],
+	[if test "$withval" = "yes" -o "$withval" = "no"; then
+		AC_MSG_ERROR([No argument for --with-db-lib])
+	fi])
+AC_ARG_WITH(db-include,
+	[  --with-db-include=dir use db headers in dir],
+	[if test "$withval" = "yes" -o "$withval" = "no"; then
+		AC_MSG_ERROR([No argument for --with-db-include])
+	fi])
+AC_ARG_ENABLE(db4,
+	[  --enable-db4          use db 4.x libraries])
+	
+	if test "X$with_db" != "X"; then
+	  if test "$with_db" != "yes"; then
+	    ac_cv_db_where_lib=$with_db/lib
+	    ac_cv_db_where_inc=$with_db/include
+	  fi
+	fi
+
+	if test "X$with_db_lib" != "X"; then
+	  ac_cv_db_where_lib=$with_db_lib
+	fi
+	if test "X$ac_cv_db_where_lib" = "X"; then
+	  CMU_DB_LIB_WHERE(/usr/athena/lib /usr/lib /usr/local/lib)
+	fi
+
+	if test "X$with_db_include" != "X"; then
+	  ac_cv_db_where_inc=$with_db_include
+	fi
+	if test "X$ac_cv_db_where_inc" = "X"; then
+	  CMU_DB_INC_WHERE(/usr/athena/include /usr/local/include)
+	fi
+
+	AC_MSG_CHECKING(whether to include db)
+	if test "X$ac_cv_db_where_lib" = "X" -o "X$ac_cv_db_where_inc" = "X"; then
+	  ac_cv_found_db=no
+	  AC_MSG_RESULT(no)
+	else
+	  ac_cv_found_db=yes
+	  AC_MSG_RESULT(yes)
+	  DB_INC_DIR=$ac_cv_db_where_inc
+	  DB_LIB_DIR=$ac_cv_db_where_lib
+	  DB_INC_FLAGS="-I${DB_INC_DIR}"
+          if test "$enable_db4" = "yes"; then
+	     DB_LIB_FLAGS="-L${DB_LIB_DIR} -ldb-4"
+          else
+	     DB_LIB_FLAGS="-L${DB_LIB_DIR} -ldb-3"
+          fi
+          dnl Do not force configure.in to put these in CFLAGS and LIBS unconditionally
+          dnl Allow makefile substitutions....
+          AC_SUBST(DB_INC_FLAGS)
+          AC_SUBST(DB_LIB_FLAGS)
+	  if test "X$RPATH" = "X"; then
+		RPATH=""
+	  fi
+	  case "${host}" in
+	    *-*-linux*)
+	      if test "X$RPATH" = "X"; then
+	        RPATH="-Wl,-rpath,${DB_LIB_DIR}"
+	      else 
+		RPATH="${RPATH}:${DB_LIB_DIR}"
+	      fi
+	      ;;
+	    *-*-hpux*)
+	      if test "X$RPATH" = "X"; then
+	        RPATH="-Wl,+b${DB_LIB_DIR}"
+	      else 
+		RPATH="${RPATH}:${DB_LIB_DIR}"
+	      fi
+	      ;;
+	    *-*-irix*)
+	      if test "X$RPATH" = "X"; then
+	        RPATH="-Wl,-rpath,${DB_LIB_DIR}"
+	      else 
+		RPATH="${RPATH}:${DB_LIB_DIR}"
+	      fi
+	      ;;
+	    *-*-solaris2*)
+	      if test "$ac_cv_prog_gcc" = yes; then
+		if test "X$RPATH" = "X"; then
+		  RPATH="-Wl,-R${DB_LIB_DIR}"
+		else 
+		  RPATH="${RPATH}:${DB_LIB_DIR}"
+		fi
+	      else
+	        RPATH="${RPATH} -R${DB_LIB_DIR}"
+	      fi
+	      ;;
+	  esac
+	  AC_SUBST(RPATH)
+	fi
+	])
+
+
+
+dnl ---- CUT HERE ---
+
+dnl These are the Cyrus Berkeley DB macros.  In an ideal world these would be
+dnl identical to the above.
+
+dnl They are here so that they can be shared between Cyrus IMAPd
+dnl and Cyrus SASL with relative ease.
+
+dnl The big difference between this and the ones above is that we don't assume
+dnl that we know the name of the library, and we try a lot of permutations
+dnl instead.  We also assume that DB4 is acceptable.
+
+dnl When we're done, there will be a BDB_LIBADD and a BDB_INCADD which should
+dnl be used when necessary.  We should probably be smarter about our RPATH
+dnl handling.
+
+dnl Call these with BERKELEY_DB_CHK.
+
+dnl We will also set $dblib to "berkeley" if we are successful, "no" otherwise.
+
+dnl this is unbelievably painful due to confusion over what db-3 should be
+dnl named and where the db-3 header file is located.  arg.
+AC_DEFUN([CYRUS_BERKELEY_DB_CHK_LIB],
+[
+	BDB_SAVE_LDFLAGS=$LDFLAGS
+
+	if test -d $with_bdb_lib; then
+	    CMU_ADD_LIBPATH_TO($with_bdb_lib, LDFLAGS)
+	    CMU_ADD_LIBPATH_TO($with_bdb_lib, BDB_LIBADD)
+	else
+	    BDB_LIBADD=""
+	fi
+
+	saved_LIBS=$LIBS
+        for dbname in db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 db3.2 db32 db-3.1 db3.1 db31 db-3 db30 db3 db
+          do
+	    LIBS="$saved_LIBS -l$dbname"
+	    AC_TRY_LINK([#include <db.h>],
+	    [db_create(NULL, NULL, 0);],
+	    BDB_LIBADD="$BDB_LIBADD -l$dbname"; dblib="berkeley"; dbname=db,
+            dblib="no")
+	    if test "$dblib" = "berkeley"; then break; fi
+          done
+        if test "$dblib" = "no"; then
+	    LIBS="$saved_LIBS -ldb"
+	    AC_TRY_LINK([#include <db.h>],
+	    [db_open(NULL, 0, 0, 0, NULL, NULL, NULL);],
+	    BDB_LIBADD="$BDB_LIBADD -ldb"; dblib="berkeley"; dbname=db,
+            dblib="no")
+        fi
+	LIBS=$saved_LIBS
+
+	LDFLAGS=$BDB_SAVE_LDFLAGS
+])
+
+AC_DEFUN([CYRUS_BERKELEY_DB_OPTS],
+[
+AC_ARG_WITH(bdb-libdir,
+	[  --with-bdb-libdir=DIR   Berkeley DB lib files are in DIR],
+	with_bdb_lib=$withval,
+	[ test "${with_bdb_lib+set}" = set || with_bdb_lib=none])
+AC_ARG_WITH(bdb-incdir,
+	[  --with-bdb-incdir=DIR   Berkeley DB include files are in DIR],
+	with_bdb_inc=$withval,
+	[ test "${with_bdb_inc+set}" = set || with_bdb_inc=none ])
+])
+
+AC_DEFUN([CYRUS_BERKELEY_DB_CHK],
+[
+	AC_REQUIRE([CYRUS_BERKELEY_DB_OPTS])
+
+	cmu_save_CPPFLAGS=$CPPFLAGS
+
+	if test -d $with_bdb_inc; then
+	    CPPFLAGS="$CPPFLAGS -I$with_bdb_inc"
+	    BDB_INCADD="-I$with_bdb_inc"
+	else
+	    BDB_INCADD=""
+	fi
+
+	dnl Note that FreeBSD puts it in a wierd place
+        dnl (but they should use with-bdb-incdir)
+        AC_CHECK_HEADER(db.h,
+                        [CYRUS_BERKELEY_DB_CHK_LIB()],
+                        dblib="no")
+
+	CPPFLAGS=$cmu_save_CPPFLAGS
+])
+
+dnl $Id: common.m4,v 1.11 2003/10/08 20:35:24 rjs3 Exp $
+
+AC_DEFUN([CMU_TEST_LIBPATH], [
+changequote(<<, >>)
+define(<<CMU_AC_CV_FOUND>>, translit(ac_cv_found_$2_lib, <<- *>>, <<__p>>))
+changequote([, ])
+if test "$CMU_AC_CV_FOUND" = "yes"; then
+  if test \! -r "$1/lib$2.a" -a \! -r "$1/lib$2.so" -a \! -r "$1/lib$2.sl"; then
+    CMU_AC_CV_FOUND=no
+  fi
+fi
+])
+
+AC_DEFUN([CMU_TEST_INCPATH], [
+changequote(<<, >>)
+define(<<CMU_AC_CV_FOUND>>, translit(ac_cv_found_$2_inc, [ *], [_p]))
+changequote([, ])
+if test "$CMU_AC_CV_FOUND" = "yes"; then
+  if test \! -r "$1/$2.h"; then
+    CMU_AC_CV_FOUND=no
+  fi
+fi
+])
+
+dnl CMU_CHECK_HEADER_NOCACHE(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+AC_DEFUN([CMU_CHECK_HEADER_NOCACHE],
+[dnl Do the transliteration at runtime so arg 1 can be a shell variable.
+ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
+AC_MSG_CHECKING([for $1])
+AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes",
+  eval "ac_cv_header_$ac_safe=no")
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  AC_MSG_RESULT(yes)
+  ifelse([$2], , :, [$2])
+else
+  AC_MSG_RESULT(no)
+ifelse([$3], , , [$3
+])dnl
+fi
+])
+
+dnl afs.m4--AFS libraries, includes, and dependencies
+dnl $Id: afs.m4,v 1.28 2004/04/29 22:00:07 cg2v Exp $
+dnl Chaskiel Grundman
+dnl based on kerberos_v4.m4
+dnl Derrick Brashear
+dnl from KTH krb and Arla
+
+AC_DEFUN([CMU_AFS_INC_WHERE1], [
+cmu_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$cmu_save_CPPFLAGS -I$1"
+AC_TRY_COMPILE([#include <afs/param.h>],
+[#ifndef SYS_NAME
+choke me
+#endif
+int foo;],
+ac_cv_found_afs_inc=yes,
+ac_cv_found_afs_inc=no)
+CPPFLAGS=$cmu_save_CPPFLAGS
+])
+
+AC_DEFUN([CMU_AFS_LIB_WHERE1], [
+save_LIBS="$LIBS"
+save_LDFLAGS="$LDFLAGS"
+
+LIBS="-lauth $1/afs/util.a $LIB_SOCKET $LIBS"
+LDFLAGS="-L$1 -L$1/afs $LDFLAGS"
+dnl suppress caching
+AC_TRY_LINK([],[afsconf_Open();], ac_cv_found_afs_lib=yes, ac_cv_found_afs_lib=no)
+LIBS="$save_LIBS"
+LDFLAGS="$save_LDFLAGS"
+])
+
+AC_DEFUN([CMU_AFS_WHERE], [
+   for i in $1; do
+      AC_MSG_CHECKING(for AFS in $i)
+      CMU_AFS_INC_WHERE1("$i/include")
+      ac_cv_found_lwp_inc=$ac_cv_found_afs_inc
+      CMU_TEST_INCPATH($i/include, lwp) 
+      ac_cv_found_afs_inc=$ac_cv_found_lwp_inc
+      if test "$ac_cv_found_afs_inc" = "yes"; then
+        CMU_AFS_LIB_WHERE1("$i/lib")
+        if test "$ac_cv_found_afs_lib" = "yes"; then
+          ac_cv_afs_where=$i
+          AC_MSG_RESULT(found)
+          break
+        else
+          AC_MSG_RESULT(not found)
+        fi
+      else
+        AC_MSG_RESULT(not found)
+      fi
+    done
+])
+
+AC_DEFUN([CMU_AFS], [
+AC_REQUIRE([CMU_SOCKETS])
+AC_REQUIRE([CMU_LIBSSL])
+AC_ARG_WITH(AFS,
+	[  --with-afs=PREFIX      Compile with AFS support],
+	[if test "X$with_AFS" = "X"; then
+		with_AFS=yes
+	fi])
+
+	if test "X$with_AFS" != "X"; then
+	  ac_cv_afs_where=$with_AFS
+	fi
+	if test "X$ac_cv_afs_where" = "X"; then
+	  CMU_AFS_WHERE(/usr/afsws /usr/local /usr/athena /Library/OpenAFS/Tools)
+	fi
+
+	AC_MSG_CHECKING(whether to include AFS)
+	if test "X$ac_cv_afs_where" = "Xno" -o "X$ac_cv_afs_where" = "X"; then
+	  ac_cv_found_afs=no
+	  AC_MSG_RESULT(no)
+	else
+	  ac_cv_found_afs=yes
+	  AC_MSG_RESULT(yes)
+	  AFS_INC_DIR="$ac_cv_afs_where/include"
+	  AFS_LIB_DIR="$ac_cv_afs_where/lib"
+	  AFS_TOP_DIR="$ac_cv_afs_where"
+	  AFS_INC_FLAGS="-I${AFS_INC_DIR}"
+          AFS_LIB_FLAGS="-L${AFS_LIB_DIR} -L${AFS_LIB_DIR}/afs"
+          cmu_save_LIBS="$LIBS"
+          cmu_save_CPPFLAGS="$CPPFLAGS"
+          CPPFLAGS="$CPPFLAGS ${AFS_INC_FLAGS}"
+	  cmu_save_LDFLAGS="$LDFLAGS"
+ 	  LDFLAGS="$cmu_save_LDFLAGS ${AFS_LIB_FLAGS}"
+                        
+          AC_CHECK_HEADERS(afs/stds.h)
+
+          AC_MSG_CHECKING([if libdes is needed])
+          AC_TRY_LINK([],[des_quad_cksum();],AFS_DES_LIB="",AFS_DES_LIB="maybe")
+          if test "X$AFS_DES_LIB" != "X"; then
+              LIBS="$cmu_save_LIBS -ldes"
+              AC_TRY_LINK([], [des_quad_cksum();],AFS_DES_LIB="yes")
+              if test "X$AFS_DES_LIB" = "Xyes"; then
+                  AC_MSG_RESULT([yes])
+    	          AFS_LIBDES="-ldes"
+    	          AFS_LIBDESA="${AFS_LIB_DIR}/libdes.a"
+    	      else
+   	          LIBS="$cmu_save_LIBS $LIBSSL_LIB_FLAGS"
+ 	          AC_TRY_LINK([],
+	          [des_quad_cksum();],AFS_DES_LIB="libcrypto")
+	          if test "X$AFS_DES_LIB" = "Xlibcrypto"; then
+	              AC_MSG_RESULT([libcrypto])
+		      AFS_LIBDES="$LIBSSL_LIB_FLAGS"
+	              AFS_LIBDESA="$LIBSSL_LIB_FLAGS"
+	          else
+         	      AC_MSG_RESULT([unknown])
+	              AC_MSG_ERROR([Could not use -ldes])
+	          fi 
+	      fi 
+	  else
+             AC_MSG_RESULT([no])
+          fi
+
+
+	  AFS_CLIENT_LIBS_STATIC="${AFS_LIB_DIR}/afs/libvolser.a ${AFS_LIB_DIR}/afs/libvldb.a ${AFS_LIB_DIR}/afs/libkauth.a ${AFS_LIB_DIR}/afs/libprot.a ${AFS_LIB_DIR}/libubik.a ${AFS_LIB_DIR}/afs/libauth.a ${AFS_LIB_DIR}/librxkad.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/afs/libsys.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/liblwp.a ${AFS_LIBDESA} ${AFS_LIB_DIR}/afs/libcmd.a ${AFS_LIB_DIR}/afs/libcom_err.a ${AFS_LIB_DIR}/afs/util.a"
+          AFS_KTC_LIBS_STATIC="${AFS_LIB_DIR}/afs/libauth.a ${AFS_LIB_DIR}/afs/libsys.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/liblwp.a ${AFS_LIBDESA} ${AFS_LIB_DIR}/afs/libcom_err.a ${AFS_LIB_DIR}/afs/util.a"
+	  AFS_CLIENT_LIBS="-lvolser -lvldb -lkauth -lprot -lubik -lauth -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a"
+	  AFS_RX_LIBS="-lauth -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a"
+          AFS_KTC_LIBS="-lauth ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcom_err ${AFS_LIB_DIR}/afs/util.a"
+
+          LIBS="$cmu_save_LIBS $AFS_CLIENT_LIBS ${LIB_SOCKET}"
+          AC_CHECK_FUNC(des_pcbc_init)
+          if test "X$ac_cv_func_des_pcbc_init" != "Xyes"; then
+           AC_CHECK_LIB(descompat, des_pcbc_init, AFS_DESCOMPAT_LIB="-ldescompat")
+           if test "X$AFS_DESCOMPAT_LIB" != "X" ; then
+                AFS_CLIENT_LIBS_STATIC="$AFS_CLIENT_LIBS_STATIC $AFS_DESCOMPAT_LIB"
+                AFS_KTC_LIBS_STATIC="$AFS_KTC_LIBS_STATIC $AFS_DESCOMPAT_LIB"
+                AFS_CLIENT_LIBS="$AFS_CLIENT_LIBS $AFS_DESCOMPAT_LIB"
+                AFS_KTC_LIBS="$AFS_KTC_LIBS $AFS_DESCOMPAT_LIB"
+           else
+
+           AC_MSG_CHECKING([if rxkad needs des_pcbc_init])
+           AC_TRY_LINK(,[tkt_DecodeTicket();],RXKAD_PROBLEM=no,RXKAD_PROBLEM=maybe)
+            if test "$RXKAD_PROBLEM" = "maybe"; then
+              AC_TRY_LINK([int des_pcbc_init() { return 0;}],
+              [tkt_DecodeTicket();],RXKAD_PROBLEM=yes,RXKAD_PROBLEM=error)
+              if test "$RXKAD_PROBLEM" = "yes"; then
+                    AC_MSG_RESULT([yes])
+                    AC_MSG_ERROR([cannot use rxkad])
+              else
+                    AC_MSG_RESULT([unknown])        
+                    AC_MSG_ERROR([Unknown error testing rxkad])
+              fi
+            else
+              AC_MSG_RESULT([no])
+            fi
+           fi
+          fi
+
+          LIBS="$cmu_save_LIBS"
+          AC_CHECK_FUNC(flock)
+          LIBS="$cmu_save_LIBS ${AFS_CLIENT_LIBS} ${LIB_SOCKET}"
+          if test "X$ac_cv_func_flock" != "Xyes"; then
+             AC_MSG_CHECKING([if AFS needs flock])
+             AC_TRY_LINK([#include <afs/param.h>
+#ifdef HAVE_AFS_STDS_H
+#include <afs/stds.h>
+#endif
+#include <ubik.h>
+#include <afs/cellconfig.h>
+#include <afs/auth.h>
+#include <afs/volser.h>
+struct ubik_client * cstruct;
+int sigvec() {return 0;}
+extern int UV_SetSecurity();],
+             [vsu_ClientInit(1,"","",0,
+                             &cstruct,UV_SetSecurity)],
+             AFS_FLOCK=no,AFS_FLOCK=yes)
+             if test $AFS_FLOCK = "no"; then
+                AC_MSG_RESULT([no])
+             else
+               AC_MSG_RESULT([yes])
+               LDFLAGS="$LDFLAGS -L/usr/ucblib"
+               AC_CHECK_LIB(ucb, flock,:, [AC_CHECK_LIB(BSD, flock)])
+             fi
+          fi
+          LIBS="$cmu_save_LIBS"
+          AC_CHECK_FUNC(sigvec)
+          LIBS="$cmu_save_LIBS ${AFS_CLIENT_LIBS} ${LIB_SOCKET}"
+          if test "X$ac_cv_func_sigvec" != "Xyes"; then
+             AC_MSG_CHECKING([if AFS needs sigvec])
+             AC_TRY_LINK([#include <afs/param.h>
+#ifdef HAVE_AFS_STDS_H
+#include <afs/stds.h>
+#endif
+#include <ubik.h>
+#include <afs/cellconfig.h>
+#include <afs/auth.h>
+#include <afs/volser.h>
+struct ubik_client * cstruct;
+int flock() {return 0;}
+extern int UV_SetSecurity();],
+             [vsu_ClientInit(1,"","",0,
+                             &cstruct,UV_SetSecurity)],
+             AFS_SIGVEC=no,AFS_SIGVEC=yes)
+             if test $AFS_SIGVEC = "no"; then
+                AC_MSG_RESULT([no])
+             else
+               AC_MSG_RESULT([yes])
+               LDFLAGS="$LDFLAGS -L/usr/ucblib"
+               AC_CHECK_LIB(ucb, sigvec,:,[AC_CHECK_LIB(BSD, sigvec)])
+             fi
+          fi
+          if test "$ac_cv_lib_ucb_flock" = "yes" -o "$ac_cv_lib_ucb_sigvec" = "yes"; then
+             AFS_LIB_FLAGS="${AFS_LIB_FLAGS} -L/usr/ucblib -R/usr/ucblib"
+          fi
+          if test "$ac_cv_lib_ucb_flock" = "yes" -o "$ac_cv_lib_ucb_sigvec" = "yes"; then
+             AFS_BSD_LIB="-lucb"
+          elif test "$ac_cv_lib_BSD_flock" = "yes" -o "$ac_cv_lib_BSD_sigvec" = "yes"; then
+             AFS_BSD_LIB="-lBSD"
+          fi
+          if test "X$AFS_BSD_LIB" != "X" ; then
+                AFS_CLIENT_LIBS_STATIC="$AFS_CLIENT_LIBS_STATIC $AFS_BSD_LIB"
+                AFS_KTC_LIBS_STATIC="$AFS_KTC_LIBS_STATIC $AFS_BSD_LIB"
+                AFS_CLIENT_LIBS="$AFS_CLIENT_LIBS $AFS_BSD_LIB"
+                AFS_RX_LIBS="$AFS_CLIENT_LIBS $AFS_BSD_LIB"
+                AFS_KTC_LIBS="$AFS_KTC_LIBS $AFS_BSD_LIB"
+          fi
+
+          AC_MSG_CHECKING([if libaudit is needed])
+	  AFS_LIBAUDIT=""
+          LIBS="$cmu_save_LIBS $AFS_CLIENT_LIBS ${LIB_SOCKET}"
+          AC_TRY_LINK([#include <afs/param.h>
+#ifdef HAVE_AFS_STDS_H
+#include <afs/stds.h>
+#endif
+#include <afs/cellconfig.h>
+#include <afs/auth.h>],
+          [afsconf_SuperUser();],AFS_AUDIT_LIB="",AFS_AUDIT_LIB="maybe")
+          if test "X$AFS_AUDIT_LIB" != "X"; then
+          LIBS="$cmu_save_LIBS -lvolser -lvldb -lkauth -lprot -lubik -lauth -laudit -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a $AFS_BSD_LIB $AFS_DESCOMPAT_LIB $LIB_SOCKET"
+             AC_TRY_LINK([#include <afs/param.h>
+#ifdef HAVE_AFS_STDS_H
+#include <afs/stds.h>
+#endif
+#include <afs/cellconfig.h>
+#include <afs/auth.h>],
+             [afsconf_SuperUser();],AFS_AUDIT_LIB="yes")
+             if test "X$AFS_AUDIT_LIB" = "Xyes"; then
+                 AC_MSG_RESULT([yes])
+	         AFS_LIBAUDIT="-laudit"
+	         AFS_CLIENT_LIBS_STATIC="${AFS_LIB_DIR}/afs/libvolser.a ${AFS_LIB_DIR}/afs/libvldb.a ${AFS_LIB_DIR}/afs/libkauth.a ${AFS_LIB_DIR}/afs/libprot.a ${AFS_LIB_DIR}/libubik.a ${AFS_LIB_DIR}/afs/libauth.a ${AFS_LIB_DIR}/afs/libaudit.a ${AFS_LIB_DIR}/librxkad.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/afs/libsys.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/liblwp.a ${AFS_LIBDESA} ${AFS_LIB_DIR}/afs/libcmd.a ${AFS_LIB_DIR}/afs/libcom_err.a ${AFS_LIB_DIR}/afs/util.a"
+                 AFS_CLIENT_LIBS="-lvolser -lvldb -lkauth -lprot -lubik -lauth -laudit -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a $AFS_BSD_LIB $AFS_DESCOMPAT_LIB"
+                 AFS_RX_LIBS="-lauth -laudit -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a $AFS_BSD_LIB $AFS_DESCOMPAT_LIB"
+             else
+                 AC_MSG_RESULT([unknown])
+                 AC_MSG_ERROR([Could not use -lauth while testing for -laudit])
+             fi 
+          else
+             AC_MSG_RESULT([no])
+          fi
+
+	  AC_CHECK_FUNCS(VL_ProbeServer)
+          AC_MSG_CHECKING([if new-style afs_ integer types are defined])
+          AC_CACHE_VAL(ac_cv_afs_int32,
+dnl The next few lines contain a quoted argument to egrep
+dnl It is critical that there be no leading or trailing whitespace
+dnl or newlines
+[AC_EGREP_CPP(dnl
+changequote(<<,>>)dnl
+<<(^|[^a-zA-Z_0-9])afs_int32[^a-zA-Z_0-9]>>dnl
+changequote([,]), [#include <afs/param.h>
+#ifdef HAVE_AFS_STDS_H
+#include <afs/stds.h>
+#endif],
+ac_cv_afs_int32=yes, ac_cv_afs_int32=no)])
+          AC_MSG_RESULT($ac_cv_afs_int32)
+          if test $ac_cv_afs_int32 = yes ; then
+            AC_DEFINE(HAVE_AFS_INT32,, [AFS provides new "unambiguous" type names])
+          else
+            AC_DEFINE(afs_int16, int16, [it's a type definition])
+            AC_DEFINE(afs_int32, int32, [it's a type definition])
+            AC_DEFINE(afs_uint16, u_int16, [it's a type definition])
+            AC_DEFINE(afs_uint32, u_int32, [it's a type definition])
+          fi
+
+          CPPFLAGS="${cmu_save_CPPFLAGS}"
+          LDFLAGS="${cmu_save_LDFLAGS}"
+          LIBS="${cmu_save_LIBS}"
+	  AC_DEFINE(AFS_ENV,, [Use AFS. (find what needs this and nuke it)])
+          AC_DEFINE(AFS,, [Use AFS. (find what needs this and nuke it)])
+          AC_SUBST(AFS_CLIENT_LIBS_STATIC)
+          AC_SUBST(AFS_KTC_LIBS_STATIC)
+          AC_SUBST(AFS_CLIENT_LIBS)
+          AC_SUBST(AFS_RX_LIBS)
+          AC_SUBST(AFS_KTC_LIBS)
+          AC_SUBST(AFS_INC_FLAGS)
+          AC_SUBST(AFS_LIB_FLAGS)
+	  AC_SUBST(AFS_TOP_DIR)
+	  AC_SUBST(AFS_LIBAUDIT)
+	  AC_SUBST(AFS_LIBDES)
+          AC_SUBST(AFS_LIBDESA)
+       	fi
+	])
+
+AC_DEFUN([CMU_NEEDS_AFS],
+[AC_REQUIRE([CMU_AFS])
+if test "$ac_cv_found_afs" != "yes"; then
+        AC_ERROR([Cannot continue without AFS])
+fi])
+
+dnl libssl.m4--Ssl libraries and includes
+dnl Derrick Brashear
+dnl from KTH kafs and Arla
+dnl $Id: libssl.m4,v 1.9 2003/10/08 20:35:25 rjs3 Exp $
+
+AC_DEFUN([CMU_LIBSSL_INC_WHERE1], [
+saved_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$saved_CPPFLAGS -I$1"
+CMU_CHECK_HEADER_NOCACHE(openssl/ssl.h,
+ac_cv_found_libssl_inc=yes,
+ac_cv_found_libssl_inc=no)
+CPPFLAGS=$saved_CPPFLAGS
+])
+
+AC_DEFUN([CMU_LIBSSL_INC_WHERE], [
+   for i in $1; do
+      AC_MSG_CHECKING(for libssl headers in $i)
+      CMU_LIBSSL_INC_WHERE1($i)
+      CMU_TEST_INCPATH($i, ssl)
+      if test "$ac_cv_found_libssl_inc" = "yes"; then
+        ac_cv_libssl_where_inc=$i
+        AC_MSG_RESULT(found)
+        break
+      else
+        AC_MSG_RESULT(not found)
+      fi
+    done
+])
+
+AC_DEFUN([CMU_LIBSSL_LIB_WHERE1], [
+saved_LIBS=$LIBS
+LIBS="$saved_LIBS -L$1 -lssl -lcrypto $LIB_SOCKET"
+AC_TRY_LINK(,
+[SSL_write();],
+[ac_cv_found_ssl_lib=yes],
+ac_cv_found_ssl_lib=no)
+LIBS=$saved_LIBS
+])
+
+AC_DEFUN([CMU_LIBSSL_LIB_WHERE], [
+   for i in $1; do
+      AC_MSG_CHECKING(for libssl libraries in $i)
+      CMU_LIBSSL_LIB_WHERE1($i)
+      dnl deal with false positives from implicit link paths
+      CMU_TEST_LIBPATH($i, ssl)
+      if test "$ac_cv_found_ssl_lib" = "yes" ; then
+        ac_cv_libssl_where_lib=$i
+        AC_MSG_RESULT(found)
+        break
+      else
+        AC_MSG_RESULT(not found)
+      fi
+    done
+])
+
+AC_DEFUN([CMU_LIBSSL], [
+AC_REQUIRE([CMU_SOCKETS])
+AC_ARG_WITH(libssl,
+	[  --with-libssl=PREFIX      Compile with Libssl support],
+	[if test "X$with_libssl" = "X"; then
+		with_libssl=yes
+	fi])
+AC_ARG_WITH(libssl-lib,
+	[  --with-libssl-lib=dir     use libssl libraries in dir],
+	[if test "$withval" = "yes" -o "$withval" = "no"; then
+		AC_MSG_ERROR([No argument for --with-libssl-lib])
+	fi])
+AC_ARG_WITH(libssl-include,
+	[  --with-libssl-include=dir use libssl headers in dir],
+	[if test "$withval" = "yes" -o "$withval" = "no"; then
+		AC_MSG_ERROR([No argument for --with-libssl-include])
+	fi])
+
+	if test "X$with_libssl" != "X"; then
+	  if test "$with_libssl" != "yes" -a "$with_libssl" != no; then
+	    ac_cv_libssl_where_lib=$with_libssl/lib
+	    ac_cv_libssl_where_inc=$with_libssl/include
+	  fi
+	fi
+
+	if test "$with_libssl" != "no"; then 
+	  if test "X$with_libssl_lib" != "X"; then
+	    ac_cv_libssl_where_lib=$with_libssl_lib
+	  fi
+	  if test "X$ac_cv_libssl_where_lib" = "X"; then
+	    CMU_LIBSSL_LIB_WHERE(/usr/local/lib/openssl /usr/lib/openssl /usr/local/lib /usr/lib)
+	  fi
+
+	  if test "X$with_libssl_include" != "X"; then
+	    ac_cv_libssl_where_inc=$with_libssl_include
+	  fi
+	  if test "X$ac_cv_libssl_where_inc" = "X"; then
+	    CMU_LIBSSL_INC_WHERE(/usr/local/include /usr/include)
+	  fi
+	fi
+
+	AC_MSG_CHECKING(whether to include libssl)
+	if test "X$ac_cv_libssl_where_lib" = "X" -a "X$ac_cv_libssl_where_inc" = "X"; then
+	  ac_cv_found_libssl=no
+	  AC_MSG_RESULT(no)
+	else
+	  ac_cv_found_libssl=yes
+	  AC_MSG_RESULT(yes)
+	  LIBSSL_INC_DIR=$ac_cv_libssl_where_inc
+	  LIBSSL_LIB_DIR=$ac_cv_libssl_where_lib
+	  LIBSSL_INC_FLAGS="-I${LIBSSL_INC_DIR}"
+	  LIBSSL_LIB_FLAGS="-L${LIBSSL_LIB_DIR} -lssl -lcrypto"
+	  if test "X$RPATH" = "X"; then
+		RPATH=""
+	  fi
+	  case "${host}" in
+	    *-*-linux*)
+	      if test "X$RPATH" = "X"; then
+	        RPATH="-Wl,-rpath,${LIBSSL_LIB_DIR}"
+	      else 
+ 		RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
+	      fi
+	      ;;
+	    *-*-hpux*)
+	      if test "X$RPATH" = "X"; then
+	        RPATH="-Wl,+b${LIBSSL_LIB_DIR}"
+	      else 
+		RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
+	      fi
+	      ;;
+	    *-*-irix*)
+	      if test "X$RPATH" = "X"; then
+	        RPATH="-Wl,-rpath,${LIBSSL_LIB_DIR}"
+	      else 
+		RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
+	      fi
+	      ;;
+	    *-*-solaris2*)
+	      if test "$ac_cv_prog_gcc" = yes; then
+		if test "X$RPATH" = "X"; then
+		  RPATH="-Wl,-R${LIBSSL_LIB_DIR}"
+		else 
+		  RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
+		fi
+	      else
+	        RPATH="${RPATH} -R${LIBSSL_LIB_DIR}"
+	      fi
+	      ;;
+	  esac
+	  AC_SUBST(RPATH)
+	fi
+	AC_SUBST(LIBSSL_INC_DIR)
+	AC_SUBST(LIBSSL_LIB_DIR)
+	AC_SUBST(LIBSSL_INC_FLAGS)
+	AC_SUBST(LIBSSL_LIB_FLAGS)
+	])
+
+
+dnl kerberos_v4.m4--Kerberos 4 libraries and includes
+dnl Derrick Brashear
+dnl from KTH krb and Arla
+dnl $Id: kerberos_v4.m4,v 1.27 2004/02/05 18:28:47 cg2v Exp $
+
+AC_DEFUN([CMU_KRB_SENDAUTH_PROTO], [
+AC_MSG_CHECKING(for krb_sendauth prototype)
+AC_TRY_COMPILE(
+[#include <krb.h>
+int krb_sendauth (long options, int fd, KTEXT ktext, char *service,
+                  char *inst, char *realm, u_long checksum,
+                  MSG_DAT *msg_data, CREDENTIALS *cred,
+                  Key_schedule schedule, struct sockaddr_in *laddr,
+                  struct sockaddr_in *faddr, char *version);],
+[int foo = krb_sendauth(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ],
+ac_cv_krb_sendauth_proto=no,
+ac_cv_krb_sendauth_proto=yes)
+AC_MSG_RESULT($ac_cv_krb_sendauth_proto)
+if test "$ac_cv_krb_sendauth_proto" = yes; then
+        AC_DEFINE(HAVE_KRB_SENDAUTH_PROTO)dnl
+fi
+AC_MSG_RESULT($ac_cv_krb_sendauth_proto)
+])
+
+AC_DEFUN([CMU_KRB_SET_KEY_PROTO], [
+AC_MSG_CHECKING(for krb_set_key prototype)
+AC_CACHE_VAL(ac_cv_krb_set_key_proto, [
+cmu_save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="${CPPFLAGS} ${KRB_INC_FLAGS}"
+AC_TRY_COMPILE(
+[#include <krb.h>
+int krb_set_key(char *key, int cvt);],
+[int foo = krb_set_key(0, 0);],
+ac_cv_krb_set_key_proto=no,
+ac_cv_krb_set_key_proto=yes)
+])
+CPPFLAGS="${cmu_save_CPPFLAGS}"
+if test "$ac_cv_krb_set_key_proto" = yes; then
+	AC_DEFINE(HAVE_KRB_SET_KEY_PROTO)dnl
+fi
+AC_MSG_RESULT($ac_cv_krb_set_key_proto)
+])
+
+AC_DEFUN([CMU_KRB4_32_DEFN], [
+AC_MSG_CHECKING(for KRB4_32 definition)
+AC_CACHE_VAL(ac_cv_krb4_32_defn, [
+cmu_save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="${CPPFLAGS} ${KRB_INC_FLAGS}"
+AC_TRY_COMPILE(
+[#include <krb.h>
+],
+[KRB4_32 foo = 1;],
+ac_cv_krb4_32_defn=yes,
+ac_cv_krb4_32_defn=no)
+])
+CPPFLAGS="${cmu_save_CPPFLAGS}"
+if test "$ac_cv_krb4_32_defn" = yes; then
+	AC_DEFINE(HAVE_KRB4_32_DEFINE)dnl
+fi
+AC_MSG_RESULT($ac_cv_krb4_32_defn)
+])
+
+AC_DEFUN([CMU_KRB_RD_REQ_PROTO], [
+AC_MSG_CHECKING(for krb_rd_req prototype)
+AC_CACHE_VAL(ac_cv_krb_rd_req_proto, [
+cmu_save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="${CPPFLAGS} ${KRB_INC_FLAGS}"
+AC_TRY_COMPILE(
+[#include <krb.h>
+int krb_rd_req(KTEXT authent, char *service, char *instance,
+unsigned KRB_INT32 from_addr, AUTH_DAT *ad, char *fn);],
+[int foo = krb_rd_req(0,0,0,0,0,0);],
+ac_cv_krb_rd_req_proto=no,
+ac_cv_krb_rd_req_proto=yes)
+])
+CPPFLAGS="${cmu_save_CPPFLAGS}"
+if test "$ac_cv_krb_rd_req_proto" = yes; then
+	AC_DEFINE(HAVE_KRB_RD_REQ_PROTO)dnl
+fi
+AC_MSG_RESULT($ac_cv_krb_rd_req_proto)
+])
+
+AC_DEFUN([CMU_KRB_INC_WHERE1], [
+saved_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$saved_CPPFLAGS -I$1"
+AC_TRY_COMPILE([#include <krb.h>],
+[struct ktext foo;],
+ac_cv_found_krb_inc=yes,
+ac_cv_found_krb_inc=no)
+if test "$ac_cv_found_krb_inc" = "no"; then
+  CPPFLAGS="$saved_CPPFLAGS -I$1 -I$1/kerberosIV"
+  AC_TRY_COMPILE([#include <krb.h>],
+  [struct ktext foo;],
+  [ac_cv_found_krb_inc=yes],
+  ac_cv_found_krb_inc=no)
+fi
+CPPFLAGS=$saved_CPPFLAGS
+])
+
+AC_DEFUN([CMU_KRB_INC_WHERE], [
+   for i in $1; do
+      AC_MSG_CHECKING(for kerberos headers in $i)
+      CMU_KRB_INC_WHERE1($i)
+      CMU_TEST_INCPATH($i, krb)
+      if test "$ac_cv_found_krb_inc" = "yes"; then
+        ac_cv_krb_where_inc=$i
+        AC_MSG_RESULT(found)
+        break
+      else
+        AC_MSG_RESULT(not found)
+      fi
+    done
+])
+
+#
+# Test for kerberos lib files
+#
+
+AC_DEFUN([CMU_KRB_LIB_WHERE1], [
+saved_LIBS=$LIBS
+LIBS="$saved_LIBS -L$1 -lkrb ${KRB_LIBDES}"
+AC_TRY_LINK(,
+[dest_tkt();],
+[ac_cv_found_krb_lib=yes],
+ac_cv_found_krb_lib=no)
+LIBS=$saved_LIBS
+])
+
+AC_DEFUN([CMU_KRB_LIB_WHERE], [
+   for i in $1; do
+      AC_MSG_CHECKING(for kerberos libraries in $i)
+      CMU_KRB_LIB_WHERE1($i)
+      dnl deal with false positives from implicit link paths
+      CMU_TEST_LIBPATH($i, krb)
+      if test "$ac_cv_found_krb_lib" = "yes" ; then
+        ac_cv_krb_where_lib=$i
+        AC_MSG_RESULT(found)
+        break
+      else
+        AC_MSG_RESULT(not found)
+      fi
+    done
+])
+
+AC_DEFUN([CMU_KRB4], [
+AC_REQUIRE([CMU_SOCKETS])
+AC_REQUIRE([CMU_LIBSSL])
+AC_ARG_WITH(krb4,
+	[  --with-krb4=PREFIX      Compile with Kerberos 4 support],
+	[if test "X$with_krb4" = "X"; then
+		with_krb4=yes
+	fi])
+AC_ARG_WITH(krb4-lib,
+	[  --with-krb4-lib=dir     use kerberos 4 libraries in dir],
+	[if test "$withval" = "yes" -o "$withval" = "no"; then
+		AC_MSG_ERROR([No argument for --with-krb4-lib])
+	fi])
+AC_ARG_WITH(krb4-include,
+	[  --with-krb4-include=dir use kerberos 4 headers in dir],
+	[if test "$withval" = "yes" -o "$withval" = "no"; then
+		AC_MSG_ERROR([No argument for --with-krb4-include])
+	fi])
+
+	if test "X$with_krb4" != "X"; then
+	  if test "$with_krb4" != "yes" -a "$with_krb4" != "no"; then
+	    ac_cv_krb_where_lib=$with_krb4/lib
+	    ac_cv_krb_where_inc=$with_krb4/include
+	  fi
+	fi
+       
+	if test "$with_krb4" != "no"; then
+	  if test "X$with_krb4_lib" != "X"; then
+	    ac_cv_krb_where_lib=$with_krb4_lib
+	  fi
+	  if test "X$with_krb4_include" != "X"; then
+	    ac_cv_krb_where_inc=$with_krb4_include
+	  fi
+	  if test "X$ac_cv_krb_where_inc" = "X"; then
+	    CMU_KRB_INC_WHERE(/usr/athena/include /usr/include/kerberosIV /usr/local/include /usr/include/kerberos)
+	  fi
+
+          AC_MSG_CHECKING([if libdes is needed])
+          AC_TRY_LINK([],[des_quad_cksum();],KRB_DES_LIB="",KRB_DES_LIB="maybe")
+          if test "X$KRB_DES_LIB" != "X"; then
+              LIBS="$cmu_save_LIBS -ldes"
+              AC_TRY_LINK([], [des_quad_cksum();],KRB_DES_LIB="yes")
+              if test "X$KRB_DES_LIB" = "Xyes"; then
+                  AC_MSG_RESULT([yes])
+                  KRB_LIBDES="-ldes"
+                  KRB_LIBDESA='$(KRB_LIB_DIR)/libdes.a'
+              else
+                  LIBS="$cmu_save_LIBS $LIBSSL_LIB_FLAGS"
+                  AC_TRY_LINK([],
+                  [des_quad_cksum();],KRB_DES_LIB="libcrypto")
+                  if test "X$KRB_DES_LIB" = "Xlibcrypto"; then
+                      AC_MSG_RESULT([libcrypto])
+                      KRB_LIBDES="$LIBSSL_LIB_FLAGS"
+                      KRB_LIBDESA="$LIBSSL_LIB_FLAGS"
+                  else
+                      AC_MSG_RESULT([unknown])
+                      AC_MSG_ERROR([Could not use -ldes])
+                  fi 
+              fi 
+          else
+             AC_MSG_RESULT([no])
+          fi
+          if test "X$ac_cv_krb_where_lib" = "X"; then
+            CMU_KRB_LIB_WHERE(/usr/athena/lib /usr/local/lib /usr/lib)
+          fi
+	fi
+	  LIBS="${cmu_save_LIBS}"
+
+
+	AC_MSG_CHECKING([whether to include kerberos 4])
+	if test "X$ac_cv_krb_where_lib" = "X" -o "X$ac_cv_krb_where_inc" = "X"; then
+	  ac_cv_found_krb=no
+	  AC_MSG_RESULT(no)
+	else
+	  ac_cv_found_krb=yes
+	  AC_MSG_RESULT(yes)
+	  KRB_INC_DIR=$ac_cv_krb_where_inc
+	  KRB_LIB_DIR=$ac_cv_krb_where_lib
+	  KRB_INC_FLAGS="-I${KRB_INC_DIR}"
+	  KRB_LIB_FLAGS="-L${KRB_LIB_DIR} -lkrb ${KRB_LIBDES}"
+	  LIBS="${cmu_save_LIBS} ${KRB_LIB_FLAGS}"
+	  AC_CHECK_LIB(resolv, dns_lookup, KRB_LIB_FLAGS="${KRB_LIB_FLAGS} -lresolv",,"${KRB_LIB_FLAGS}")
+	  AC_CHECK_LIB(crypt, crypt, KRB_LIB_FLAGS="${KRB_LIB_FLAGS} -lcrypt",,"${KRB_LIB_FLAGS}")
+	  LIBS="${LIBS} ${KRB_LIB_FLAGS}"
+	  AC_CHECK_FUNCS(krb_get_int krb_life_to_time)
+          AC_SUBST(KRB_INC_FLAGS)
+          AC_SUBST(KRB_LIB_FLAGS)
+	  LIBS="${cmu_save_LIBS}"
+	  AC_DEFINE(KERBEROS,,[Use kerberos 4. find out what needs this symbol])
+	  if test "X$RPATH" = "X"; then
+		RPATH=""
+	  fi
+	  case "${host}" in
+	    *-*-linux*)
+	      if test "X$RPATH" = "X"; then
+	        RPATH="-Wl,-rpath,${KRB_LIB_DIR}"
+	      else 
+		RPATH="${RPATH}:${KRB_LIB_DIR}"
+	      fi
+	      ;;
+	    *-*-hpux*)
+	      if test "X$RPATH" = "X"; then
+	        RPATH="-Wl,+b${KRB_LIB_DIR}"
+	      else 
+		RPATH="${RPATH}:${KRB_LIB_DIR}"
+	      fi
+	      ;;
+	    *-*-irix*)
+	      if test "X$RPATH" = "X"; then
+	        RPATH="-Wl,-rpath,${KRB_LIB_DIR}"
+	      else 
+		RPATH="${RPATH}:${KRB_LIB_DIR}"
+	      fi
+	      ;;
+	    *-*-solaris2*)
+	      if test "$ac_cv_prog_gcc" = yes; then
+		if test "X$RPATH" = "X"; then
+		  RPATH="-Wl,-R${KRB_LIB_DIR}"
+		else 
+		  RPATH="${RPATH}:${KRB_LIB_DIR}"
+		fi
+	      else
+	        RPATH="${RPATH} -R${KRB_LIB_DIR}"
+	      fi
+	      ;;
+	  esac
+	  AC_SUBST(RPATH)
+	fi
+	])
+
+
+dnl sasl2.m4--sasl2 libraries and includes
+dnl Rob Siemborski
+dnl $Id: sasl2.m4,v 1.48 2004/09/13 21:06:34 shadow Exp $
+
+AC_DEFUN([SASL_GSSAPI_CHK],[
+ AC_ARG_ENABLE(gssapi, [  --enable-gssapi=<DIR>   enable GSSAPI authentication [yes] ],
+    gssapi=$enableval,
+    gssapi=yes)
+ AC_ARG_WITH(gss_impl, [  --with-gss_impl={heimdal|mit|cybersafe|seam|auto}                                                       choose specific GSSAPI implementation [[auto]] ],
+    gss_impl=$withval,
+    gss_impl=auto)
+ AC_REQUIRE([SASL2_CRYPT_CHK])
+ AC_REQUIRE([CMU_SOCKETS])
+
+ if test "$gssapi" != no; then
+    platform=
+    case "${host}" in
+      *-*-linux*)
+        platform=__linux
+        ;;
+      *-*-hpux*)
+        platform=__hpux
+        ;;
+      *-*-irix*)
+        platform=__irix
+        ;;
+      *-*-solaris2*)
+# When should we use __sunos?
+        platform=__solaris
+        ;;
+      *-*-aix*)
+        platform=__aix
+        ;;
+      *)
+        AC_WARN([The system type is not recognized. If you believe that CyberSafe GSSAPI works on this platform, please update the configure script])
+	if test "$gss_impl" = "cybersafe"; then
+	   AC_ERROR([CyberSafe was forced, cannot continue as platform is not supported])
+	fi
+        ;;
+    esac
+
+    cmu_saved_CPPFLAGS=$CPPFLAGS
+
+    if test -d ${gssapi}; then
+       CPPFLAGS="$CPPFLAGS -I$gssapi/include"
+# We want to keep -I in our CPPFLAGS, but only if we succeed
+       cmu_saved_CPPFLAGS=$CPPFLAGS
+       LDFLAGS="$LDFLAGS -L$gssapi/lib"
+
+       if test -n "$platform"; then
+         if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then
+           CPPFLAGS="$CPPFLAGS -D$platform"
+           if test -d "${gssapi}/appsec-sdk/include"; then
+             CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include"
+           fi
+         fi
+       fi
+    fi
+    AC_CHECK_HEADER(gssapi.h, AC_DEFINE(HAVE_GSSAPI_H,,[Define if you have the gssapi.h header file]), [
+      AC_CHECK_HEADER(gssapi/gssapi.h,, AC_WARN(Disabling GSSAPI - no include files found); gssapi=no)])
+
+    CPPFLAGS=$cmu_saved_CPPFLAGS
+
+ fi
+
+ if test "$gssapi" != no; then
+  dnl We need to find out which gssapi implementation we are
+  dnl using. Supported alternatives are: MIT Kerberos 5,
+  dnl Heimdal Kerberos 5 (http://www.pdc.kth.se/heimdal),
+  dnl CyberSafe Kerberos 5 (http://www.cybersafe.com/)
+  dnl and Sun SEAM (http://wwws.sun.com/software/security/kerberos/)
+  dnl
+  dnl The choice is reflected in GSSAPIBASE_LIBS
+
+  AC_CHECK_LIB(resolv,res_search)
+  if test -d ${gssapi}; then
+     gssapi_dir="${gssapi}/lib"
+     GSSAPIBASE_LIBS="-L$gssapi_dir"
+     GSSAPIBASE_STATIC_LIBS="-L$gssapi_dir"
+  else
+     dnl FIXME: This is only used for building cyrus, and then only as
+     dnl a real hack.  it needs to be fixed.
+     gssapi_dir="/usr/local/lib"
+  fi
+
+  # Check a full link against the Heimdal libraries.
+  # If this fails, check a full link against the MIT libraries.
+  # If this fails, check a full link against the CyberSafe libraries.
+  # If this fails, check a full link against the Solaris 8 and up libgss.
+
+  if test "$gss_impl" = "auto" -o "$gss_impl" = "heimdal"; then
+    gss_failed=0
+    AC_CHECK_LIB(gssapi,gss_unwrap,gss_impl="heimdal",gss_failed=1,$GSSAPIBASE_LIBS -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err ${LIB_SOCKET})
+    if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then
+      gss_impl="failed"
+    fi
+  fi
+
+  if test "$gss_impl" = "auto" -o "$gss_impl" = "mit"; then
+    gss_failed=0
+    AC_CHECK_LIB(gssapi_krb5,gss_unwrap,gss_impl="mit",gss_failed=1,$GSSAPIBASE_LIBS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${LIB_SOCKET})
+    if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then
+      gss_impl="failed"
+    fi
+  fi
+
+  # For Cybersafe one has to set a platform define in order to make compilation work
+  if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then
+
+    cmu_saved_CPPFLAGS=$CPPFLAGS
+    cmu_saved_GSSAPIBASE_LIBS=$GSSAPIBASE_LIBS
+# FIX ME - Note that the libraries are in .../lib/64 for 64bit kernels
+    if test -d "${gssapi}/appsec-rt/lib"; then
+      GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -L${gssapi}/appsec-rt/lib"
+    fi
+    CPPFLAGS="$CPPFLAGS -D$platform"
+    if test -d "${gssapi}/appsec-sdk/include"; then
+      CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include"
+    fi
+
+    gss_failed=0
+
+# Check for CyberSafe with two libraries first, than fall back to a single 
+# library (older CyberSafe)
+
+    unset ac_cv_lib_gss_csf_gss_acq_user
+    AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe03",[
+      unset ac_cv_lib_gss_csf_gss_acq_user;AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe",gss_failed=1,$GSSAPIBASE_LIBS -lgss)],$GSSAPIBASE_LIBS -lgss -lcstbk5)
+
+    if test "$gss_failed" = "1"; then
+# Restore variables
+      GSSAPIBASE_LIBS=$cmu_saved_GSSAPIBASE_LIBS
+      CPPFLAGS=$cmu_saved_CPPFLAGS
+
+      if test "$gss_impl" != "auto"; then
+        gss_impl="failed"
+      fi
+    fi
+  fi
+
+  if test "$gss_impl" = "auto" -o "$gss_impl" = "seam"; then
+    gss_failed=0
+    AC_CHECK_LIB(gss,gss_unwrap,gss_impl="seam",gss_failed=1,-lgss)
+    if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then
+      gss_impl="failed"
+    fi
+  fi
+
+  if test "$gss_impl" = "mit"; then
+    GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err"
+    GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_LIBS $gssapi_dir/libgssapi_krb5.a $gssapi_dir/libkrb5.a $gssapi_dir/libk5crypto.a $gssapi_dir/libcom_err.a"
+  elif test "$gss_impl" = "heimdal"; then
+    CPPFLAGS="$CPPFLAGS -DKRB5_HEIMDAL"
+    GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err"
+    GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_STATIC_LIBS $gssapi_dir/libgssapi.a $gssapi_dir/libkrb5.a $gssapi_dir/libasn1.a $gssapi_dir/libroken.a $gssapi_dir/libcom_err.a ${LIB_CRYPT}"
+  elif test "$gss_impl" = "cybersafe03"; then
+# Version of CyberSafe with two libraries
+    CPPFLAGS="$CPPFLAGS -D$platform -I${gssapi}/appsec-sdk/include"
+    GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgss -lcstbk5"
+    # there is no static libgss for CyberSafe
+    GSSAPIBASE_STATIC_LIBS=none
+  elif test "$gss_impl" = "cybersafe"; then
+    CPPFLAGS="$CPPFLAGS -D$platform -I${gssapi}/appsec-sdk/include"
+    GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgss"
+    # there is no static libgss for CyberSafe
+    GSSAPIBASE_STATIC_LIBS=none
+  elif test "$gss_impl" = "seam"; then
+    GSSAPIBASE_LIBS=-lgss
+    # there is no static libgss on Solaris 8 and up
+    GSSAPIBASE_STATIC_LIBS=none
+  elif test "$gss_impl" = "failed"; then
+    gssapi="no"
+    GSSAPIBASE_LIBS=
+    GSSAPIBASE_STATIC_LIBS=
+    AC_WARN(Disabling GSSAPI - specified library not found)
+  else
+    gssapi="no"
+    GSSAPIBASE_LIBS=
+    GSSAPIBASE_STATIC_LIBS=
+    AC_WARN(Disabling GSSAPI - no library)
+  fi
+ fi
+
+#
+# Cybersafe defines both GSS_C_NT_HOSTBASED_SERVICE and GSS_C_NT_USER_NAME in gssapi\rfckrb5.h
+#
+ if test "$gssapi" != "no"; then
+  if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then
+   AC_EGREP_CPP(hostbased_service_gss_nt_yes,
+    [#include <gssapi/gssapi.h>
+     #ifdef GSS_C_NT_HOSTBASED_SERVICE
+      hostbased_service_gss_nt_yes
+     #endif
+    ], AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,[Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE]), AC_WARN(Cybersafe define not found))
+
+  elif test "$ac_cv_header_gssapi_h" = "yes"; then
+   AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h,
+     AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,[Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE]))
+  elif test "$ac_cv_header_gssapi_gssapi_h"; then
+
+   AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h,
+     AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,[Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE]))
+  fi
+
+  if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then
+   AC_EGREP_CPP(user_name_yes_gss_nt,
+    [#include <gssapi/gssapi.h>
+     #ifdef GSS_C_NT_USER_NAME
+      user_name_yes_gss_nt
+     #endif
+    ], AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,[Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME]), AC_WARN(Cybersafe define not found))
+  elif test "$ac_cv_header_gssapi_h" = "yes"; then
+   AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi.h,
+    AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,[Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME]))
+  elif test "$ac_cv_header_gssapi_gssapi_h"; then
+   AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi/gssapi.h,
+    AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,[Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME]))
+  fi
+ fi
+
+ GSSAPI_LIBS=""
+ AC_MSG_CHECKING(GSSAPI)
+ if test "$gssapi" != no; then
+  AC_MSG_RESULT(with implementation ${gss_impl})
+  AC_CHECK_LIB(resolv,res_search,GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lresolv")
+  SASL_MECHS="$SASL_MECHS libgssapiv2.la"
+  SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/gssapi.o"
+
+  cmu_save_LIBS="$LIBS"
+  LIBS="$LIBS $GSSAPIBASE_LIBS"
+  AC_CHECK_FUNCS(gsskrb5_register_acceptor_identity)
+  LIBS="$cmu_save_LIBS"
+else
+  AC_MSG_RESULT(disabled)
+fi
+AC_SUBST(GSSAPI_LIBS)
+AC_SUBST(GSSAPIBASE_LIBS)
+])
+
+AC_DEFUN([SASL_SET_GSSAPI_LIBS], [
+    SASL_GSSAPI_LIBS_SET="yes"
+])
+
+dnl What we want to do here is setup LIB_SASL with what one would
+dnl generally want to have (e.g. if static is requested, make it that,
+dnl otherwise make it dynamic.
+
+dnl We also want to create LIB_DYN_SASL and DYNSASLFLAGS.
+
+dnl Also sets using_static_sasl to "no" "static" or "staticonly"
+
+AC_DEFUN([CMU_SASL2], [
+	AC_REQUIRE([SASL_GSSAPI_CHK])
+
+AC_ARG_WITH(sasl,
+            [  --with-sasl=DIR         Compile with libsasl2 in <DIR>],
+	    with_sasl="$withval",
+            with_sasl="yes")
+
+AC_ARG_WITH(staticsasl,
+	    [  --with-staticsasl=DIR   Compile with staticly linked libsasl2 in <DIR>],
+	    with_staticsasl="$withval";
+	    if test $with_staticsasl != "no"; then
+		using_static_sasl="static"
+	    fi,
+	    with_staticsasl="no"; using_static_sasl="no")
+
+	SASLFLAGS=""
+	LIB_SASL=""
+
+	cmu_saved_CPPFLAGS=$CPPFLAGS
+	cmu_saved_LDFLAGS=$LDFLAGS
+	cmu_saved_LIBS=$LIBS
+
+	if test ${with_staticsasl} != "no"; then
+	  if test -d ${with_staticsasl}; then
+	    if test -d ${with_staticsasl}/lib64 ; then
+	      ac_cv_sasl_where_lib=${with_staticsasl}/lib64
+	    else
+	      ac_cv_sasl_where_lib=${with_staticsasl}/lib
+	    fi
+	    ac_cv_sasl_where_lib=${with_staticsasl}/lib
+	    ac_cv_sasl_where_inc=${with_staticsasl}/include
+
+	    SASLFLAGS="-I$ac_cv_sasl_where_inc"
+	    LIB_SASL="-L$ac_cv_sasl_where_lib"
+	    CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
+	    LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
+	  else
+	    with_staticsasl="/usr"
+	  fi
+
+	  AC_CHECK_HEADER(sasl/sasl.h, [
+	    AC_CHECK_HEADER(sasl/saslutil.h, [
+	     for i42 in lib64 lib; do
+	        if test -r ${with_staticsasl}/$i42/libsasl2.a; then
+		  ac_cv_found_sasl=yes
+		  AC_MSG_CHECKING(for static libsasl)
+		  LIB_SASL="$LIB_SASL ${with_staticsasl}/$i42/libsasl2.a"
+		fi
+	     done
+             if test ! "$ac_cv_found_sasl" = "yes"; then
+	          AC_MSG_CHECKING(for static libsasl)
+		  AC_ERROR([Could not find ${with_staticsasl}/lib*/libsasl2.a])
+             fi
+	    ])])
+
+	  AC_MSG_RESULT(found)
+
+          if test "x$SASL_GSSAPI_LIBS_SET" = "x"; then
+	    LIB_SASL="$LIB_SASL $GSSAPIBASE_STATIC_LIBS"
+	  else
+	    SASL_GSSAPI_LIBS_SET=""
+	    cmu_saved_LIBS="$GSSAPIBASE_STATIC_LIBS $cmu_saved_LIBS" 
+	  fi
+	fi
+
+	if test -d ${with_sasl}; then
+            ac_cv_sasl_where_lib=${with_sasl}/lib
+            ac_cv_sasl_where_inc=${with_sasl}/include
+
+	    DYNSASLFLAGS="-I$ac_cv_sasl_where_inc"
+	    if test "$ac_cv_sasl_where_lib" != ""; then
+		CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, LIB_DYN_SASL)
+	    fi
+	    LIB_DYN_SASL="$LIB_DYN_SASL -lsasl2"
+	    CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
+	    LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
+	fi
+
+	dnl be sure to check for a SASLv2 specific function
+	AC_CHECK_HEADER(sasl/sasl.h, [
+	    AC_CHECK_HEADER(sasl/saslutil.h, [
+	      AC_CHECK_LIB(sasl2, prop_get, 
+                           ac_cv_found_sasl=yes,
+		           ac_cv_found_sasl=no)],
+	                   ac_cv_found_sasl=no)], ac_cv_found_sasl=no)
+
+	if test "$ac_cv_found_sasl" = "yes"; then
+	    if test "$ac_cv_sasl_where_lib" != ""; then
+	        CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, DYNLIB_SASL)
+	    fi
+	    DYNLIB_SASL="$DYNLIB_SASL -lsasl2"
+	    if test "$using_static_sasl" != "static"; then
+		LIB_SASL=$DYNLIB_SASL
+		SASLFLAGS=$DYNSASLFLAGS
+	    fi
+	else
+	    DYNLIB_SASL=""
+	    DYNSASLFLAGS=""
+	    using_static_sasl="staticonly"
+	fi
+
+        if test "x$SASL_GSSAPI_LIBS_SET" != "x"; then
+	    SASL_GSSAPI_LIBS_SET=""
+	    cmu_saved_LIBS="$GSSAPIBASE_LIBS $cmu_saved_LIBS" 
+	fi
+
+	LIBS="$cmu_saved_LIBS"
+	LDFLAGS="$cmu_saved_LDFLAGS"
+	CPPFLAGS="$cmu_saved_CPPFLAGS"
+
+	AC_SUBST(LIB_DYN_SASL)
+	AC_SUBST(DYNSASLFLAGS)
+	AC_SUBST(LIB_SASL)
+	AC_SUBST(SASLFLAGS)
+	])
+
+AC_DEFUN([CMU_SASL2_REQUIRED],
+[AC_REQUIRE([CMU_SASL2])
+if test "$ac_cv_found_sasl" != "yes"; then
+        AC_ERROR([Cannot continue without libsasl2.
+Get it from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/.])
+fi])
+
+AC_DEFUN([CMU_SASL2_REQUIRE_VER], [
+	AC_REQUIRE([CMU_SASL2_REQUIRED])
+
+	cmu_saved_CPPFLAGS=$CPPFLAGS
+	CPPFLAGS="$CPPFLAGS $SASLFLAGS"
+
+	AC_TRY_CPP([
+#include <sasl/sasl.h>
+
+#ifndef SASL_VERSION_MAJOR
+#error SASL_VERSION_MAJOR not defined
+#endif
+#ifndef SASL_VERSION_MINOR
+#error SASL_VERSION_MINOR not defined
+#endif
+#ifndef SASL_VERSION_STEP
+#error SASL_VERSION_STEP not defined
+#endif
+
+#if SASL_VERSION_MAJOR < $1 || SASL_VERSION_MINOR < $2 || SASL_VERSION_STEP < $3
+#error SASL version is less than $1.$2.$3
+#endif
+	],,AC_ERROR([Incorrect SASL headers found.  This package requires SASL $1.$2.$3 or newer.]))
+
+	CPPFLAGS=$cmu_saved_CPPFLAGS
+])
+
+AC_DEFUN([CMU_SASL2_CHECKAPOP_REQUIRED], [
+	AC_REQUIRE([CMU_SASL2_REQUIRED])
+
+	cmu_saved_LDFLAGS=$LDFLAGS
+
+	LDFLAGS="$LDFLAGS $LIB_SASL"
+
+	AC_CHECK_LIB(sasl2, sasl_checkapop, AC_DEFINE(HAVE_APOP,[],[Does SASL support APOP?]),
+		AC_MSG_ERROR([libsasl2 without working sasl_checkapop.  Cannot continue.]))
+
+	LDFLAGS=$cmu_saved_LDFLAGS
+])
+
+AC_DEFUN([SASL2_CRYPT_CHK],[
+ AC_CHECK_FUNC(crypt, cmu_have_crypt=yes, [
+  AC_CHECK_LIB(crypt, crypt,
+	       LIB_CRYPT="-lcrypt"; cmu_have_crypt=yes,
+	       cmu_have_crypt=no)])
+ AC_SUBST(LIB_CRYPT)
+])
+
+dnl libwrap.m4 --- do we have libwrap, the access control library?
+dnl $Id: libwrap.m4,v 1.9 2003/10/22 18:50:02 rjs3 Exp $
+
+AC_DEFUN([CMU_LIBWRAP], [
+  AC_REQUIRE([CMU_SOCKETS])
+  AC_ARG_WITH(libwrap, 
+              [  --with-libwrap=DIR      use libwrap (rooted in DIR) [yes] ],
+              with_libwrap=$withval, with_libwrap=yes)
+  if test "$with_libwrap" != no; then
+    if test -d "$with_libwrap"; then
+      CPPFLAGS="$CPPFLAGS -I${with_libwrap}/include"
+      LDFLAGS="$LDFLAGS -L${with_libwrap}/lib"
+    fi
+    cmu_save_LIBS="$LIBS"
+    AC_CHECK_LIB(wrap, request_init, [
+		 AC_CHECK_HEADER(tcpd.h,, with_libwrap=no)],
+		 with_libwrap=no, ${LIB_SOCKET})
+    LIBS="$cmu_save_LIBS"
+  fi
+  AC_MSG_CHECKING(libwrap support)
+  AC_MSG_RESULT($with_libwrap)
+  LIB_WRAP=""
+  if test "$with_libwrap" != no; then
+    AC_DEFINE(HAVE_LIBWRAP,[],[Do we have TCP wrappers?])
+    LIB_WRAP="-lwrap"
+    AC_CHECK_LIB(nsl, yp_get_default_domain, LIB_WRAP="${LIB_WRAP} -lnsl")
+  fi
+  AC_SUBST(LIB_WRAP)
+])
+
+dnl look for the (ucd|net)snmp libraries
+dnl $Id: ucdsnmp.m4,v 1.10 2004/05/24 19:25:41 ken3 Exp $
+
+AC_DEFUN([CMU_UCDSNMP], [
+  AC_REQUIRE([CMU_SOCKETS])
+  AC_ARG_WITH(snmp, 
+              [  --with-snmp=DIR         use ucd|net snmp (rooted in DIR) [yes] ],
+              with_snmp=$withval, with_snmp=yes)
+
+  dnl
+  dnl Maintain backwards compatibility with old --with-ucdsnmp option
+  dnl
+  AC_ARG_WITH(ucdsnmp,, with_snmp=$withval,)
+
+if test "$with_snmp" != "no"; then
+
+  dnl
+  dnl Try net-snmp first
+  dnl
+  if test "$with_snmp" = "yes"; then
+    AC_PATH_PROG(SNMP_CONFIG,net-snmp-config,,[/usr/local/bin:$PATH])
+  else
+    SNMP_CONFIG="$with_snmp/bin/net-snmp-config"
+  fi
+
+  if test -x "$SNMP_CONFIG"; then
+    AC_MSG_CHECKING(NET SNMP libraries)
+
+    SNMP_LIBS=`$SNMP_CONFIG --agent-libs`
+    SNMP_PREFIX=`$SNMP_CONFIG --prefix`
+
+    if test -n "$SNMP_LIBS" && test -n "$SNMP_PREFIX"; then
+      CPPFLAGS="$CPPFLAGS -I${SNMP_PREFIX}/include"
+      LIB_UCDSNMP=$SNMP_LIBS
+      AC_DEFINE(HAVE_NETSNMP,1,[Do we have Net-SNMP support?])
+      AC_SUBST(LIB_UCDSNMP)
+      AC_MSG_RESULT(yes)
+    else
+      AC_MSG_RESULT(no)
+      AC_MSG_WARN([Could not find the required paths. Please check your net-snmp installation.])
+    fi
+  else
+    dnl
+    dnl Try ucd-snmp if net-snmp test failed
+    dnl
+    if test "$with_snmp" != no; then
+      if test -d "$with_snmp"; then
+        CPPFLAGS="$CPPFLAGS -I${with_snmp}/include"
+        LDFLAGS="$LDFLAGS -L${with_snmp}/lib"
+      fi
+      cmu_save_LIBS="$LIBS"
+      AC_CHECK_LIB(snmp, sprint_objid, [
+  		 AC_CHECK_HEADER(ucd-snmp/version.h,, with_snmp=no)],
+  		 with_snmp=no, ${LIB_SOCKET})
+      LIBS="$cmu_save_LIBS"
+    fi
+    AC_MSG_CHECKING(UCD SNMP libraries)
+    AC_MSG_RESULT($with_snmp)
+    LIB_UCDSNMP=""
+    if test "$with_snmp" != no; then
+      AC_DEFINE(HAVE_UCDSNMP,1,[Do we have UCD-SNMP support?])
+      LIB_UCDSNMP="-lucdagent -lucdmibs -lsnmp"
+      AC_CHECK_LIB(rpm, rpmdbOpen,
+		 LIB_UCDSNMP="${LIB_UCDSNMP} -lrpm -lpopt",,-lpopt)
+    fi
+    AC_SUBST(LIB_UCDSNMP)
+  fi
+fi
+
+])
+

Modified: trunk/cyrus-imapd-2.2.12/cmulocal/cyrus.m4
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/cmulocal/cyrus.m4?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/cmulocal/cyrus.m4&r1=172&p2=trunk/cyrus-imapd-2.2.12/cmulocal/cyrus.m4&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/cmulocal/cyrus.m4 (original)
+++ trunk/cyrus-imapd-2.2.12/cmulocal/cyrus.m4 Fri Nov 11 17:15:40 2005
@@ -3,7 +3,6 @@
 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.
@@ -31,8 +30,16 @@
 ])
 
 dnl runpath initialization
-dnl (disabled by hmh at debian.org
 AC_DEFUN([CMU_GUESS_RUNPATH_SWITCH], [
    # CMU GUESS RUNPATH SWITCH
-    andrew_runpath_switch="none"
-])
+  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}"
+  ])])

Modified: trunk/cyrus-imapd-2.2.12/configure.in
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/configure.in?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/configure.in&r1=172&p2=trunk/cyrus-imapd-2.2.12/configure.in&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/configure.in (original)
+++ trunk/cyrus-imapd-2.2.12/configure.in Fri Nov 11 17:15:40 2005
@@ -50,11 +50,6 @@
 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],
@@ -99,12 +94,10 @@
 AC_ISC_POSIX
 AC_PROG_AWK
 AC_C_CONST
-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_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
 AC_C_INLINE
 
 CMU_C___ATTRIBUTE__
@@ -1223,11 +1216,7 @@
     SQUAT_ENGINE = 1,
 
     /* should we have long LMTP error messages? */
-    LMTP_LONG_ERROR_MSGS = 1,
-
-    /* default time to wait, in seconds, before giving up
-     * trying to lock something */
-    LOCK_GIVEUP_TIMER_DEFAULT = 100
+    LMTP_LONG_ERROR_MSGS = 1
 };
 
 #endif /* _CYRUS_IMAPD_CONFIG_H_ */

Modified: trunk/cyrus-imapd-2.2.12/debian/patches/00list
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/00list?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/debian/patches/00list&r1=172&p2=trunk/cyrus-imapd-2.2.12/debian/patches/00list&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/00list (original)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/00list Fri Nov 11 17:15:40 2005
@@ -1,4 +1,25 @@
+01-fix_Makefile.in.dpatch
+02-add_mkinstalldirs.dpatch
+03-fix_docs.dpatch
+04-add_autogen.sh.dpatch
+05-fix_programnames.dpatch
+06-disable_runpath.dpatch
+07-update_aclocal_and_configure.in.dpatch
+08-clean_socket_closes.dpatch
+09-kerberos-ipv4-ipv6-kludge-removal.dpatch
+10-fix_potential_overflows.dpatch
+11-fix_syslog_prefix.dpatch
+12-fix_timeout_handling.dpatch
+13-master_process_handling.dpatch
+14-xmalloc.dpatch
+15-munge_8bit.dpatch
+16-fix_mib.dpatch
+17-fix_tail_syntax_in_xversion.h.dpatch
+18-fix_strlen_return_type.dpatch
+19-fix_tls_ssl.dpatch
 20_drac_auth.dpatch
+21-fix_config-parsing.dpatch
+22-imapd_index_check.dpatch
 25_update_install-sh.dpatch
 30_update_perlcalling.sh.dpatch
 35_masssievec_remove_unused_variable.dpatch

Added: trunk/cyrus-imapd-2.2.12/debian/patches/01-fix_Makefile.in.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/01-fix_Makefile.in.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/01-fix_Makefile.in.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/01-fix_Makefile.in.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,162 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01-fix_Makefile.in.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix all Makefile.in files as necessary
+
+ at DPATCH@
+diff -urNad complete.dpatch/Makefile.in /tmp/dpep.hthEz2/complete.dpatch/Makefile.in
+--- complete.dpatch/Makefile.in	2005-02-14 17:43:44.000000000 +0100
++++ /tmp/dpep.hthEz2/complete.dpatch/Makefile.in	2005-11-10 16:34:20.133821819 +0100
+@@ -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@
+diff -urNad complete.dpatch/imap/Makefile.in /tmp/dpep.hthEz2/complete.dpatch/imap/Makefile.in
+--- complete.dpatch/imap/Makefile.in	2004-05-28 20:03:02.000000000 +0200
++++ /tmp/dpep.hthEz2/complete.dpatch/imap/Makefile.in	2005-11-10 16:34:20.133821819 +0100
+@@ -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
+diff -urNad complete.dpatch/installsieve/Makefile.in /tmp/dpep.hthEz2/complete.dpatch/installsieve/Makefile.in
+--- complete.dpatch/installsieve/Makefile.in	2003-10-22 20:50:11.000000000 +0200
++++ /tmp/dpep.hthEz2/complete.dpatch/installsieve/Makefile.in	2005-11-10 16:34:20.134821720 +0100
+@@ -48,7 +48,7 @@
+ 
+ DEFS = @DEFS@
+ CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)/../lib @CPPFLAGS@ @SASLFLAGS@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ @WARNERROR@
+ LDFLAGS = @LDFLAGS@
+ 
+ INSTALL = @INSTALL@
+diff -urNad complete.dpatch/lib/Makefile.in /tmp/dpep.hthEz2/complete.dpatch/lib/Makefile.in
+--- complete.dpatch/lib/Makefile.in	2004-05-28 20:03:04.000000000 +0200
++++ /tmp/dpep.hthEz2/complete.dpatch/lib/Makefile.in	2005-11-10 16:34:20.134821720 +0100
+@@ -62,7 +62,7 @@
+ LIBS = @LIBS@
+ 
+ MAKEDEPEND_CFLAGS = @CFLAGS@
+-CFLAGS = @CFLAGS@ @PERL_CCCDLFLAGS@
++CFLAGS = @CFLAGS@ @PERL_CCCDLFLAGS@ @WARNERROR@ -fPIC
+ LDFLAGS = @LDFLAGS@
+ 
+ SHELL = /bin/sh
+diff -urNad complete.dpatch/master/Makefile.in /tmp/dpep.hthEz2/complete.dpatch/master/Makefile.in
+--- complete.dpatch/master/Makefile.in	2004-12-17 17:32:24.000000000 +0100
++++ /tmp/dpep.hthEz2/complete.dpatch/master/Makefile.in	2005-11-10 16:34:20.134821720 +0100
+@@ -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@
+ 
+diff -urNad complete.dpatch/notifyd/Makefile.in /tmp/dpep.hthEz2/complete.dpatch/notifyd/Makefile.in
+--- complete.dpatch/notifyd/Makefile.in	2004-05-28 20:03:06.000000000 +0200
++++ /tmp/dpep.hthEz2/complete.dpatch/notifyd/Makefile.in	2005-11-10 16:34:20.135821621 +0100
+@@ -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@
+diff -urNad complete.dpatch/perl/Makefile.in /tmp/dpep.hthEz2/complete.dpatch/perl/Makefile.in
+--- complete.dpatch/perl/Makefile.in	2003-10-22 20:50:17.000000000 +0200
++++ /tmp/dpep.hthEz2/complete.dpatch/perl/Makefile.in	2005-11-10 16:34:20.135821621 +0100
+@@ -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::
+diff -urNad complete.dpatch/perl/sieve/Makefile.in /tmp/dpep.hthEz2/complete.dpatch/perl/sieve/Makefile.in
+--- complete.dpatch/perl/sieve/Makefile.in	2003-10-22 20:50:24.000000000 +0200
++++ /tmp/dpep.hthEz2/complete.dpatch/perl/sieve/Makefile.in	2005-11-10 16:34:20.135821621 +0100
+@@ -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::
+diff -urNad complete.dpatch/perl/sieve/lib/Makefile.in /tmp/dpep.hthEz2/complete.dpatch/perl/sieve/lib/Makefile.in
+--- complete.dpatch/perl/sieve/lib/Makefile.in	2004-05-28 20:03:07.000000000 +0200
++++ /tmp/dpep.hthEz2/complete.dpatch/perl/sieve/lib/Makefile.in	2005-11-10 16:34:20.136821523 +0100
+@@ -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
+diff -urNad complete.dpatch/sieve/Makefile.in /tmp/dpep.hthEz2/complete.dpatch/sieve/Makefile.in
+--- complete.dpatch/sieve/Makefile.in	2004-05-28 20:03:09.000000000 +0200
++++ /tmp/dpep.hthEz2/complete.dpatch/sieve/Makefile.in	2005-11-10 16:34:20.136821523 +0100
+@@ -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
+diff -urNad complete.dpatch/timsieved/Makefile.in /tmp/dpep.hthEz2/complete.dpatch/timsieved/Makefile.in
+--- complete.dpatch/timsieved/Makefile.in	2004-05-28 20:03:10.000000000 +0200
++++ /tmp/dpep.hthEz2/complete.dpatch/timsieved/Makefile.in	2005-11-10 16:34:20.136821523 +0100
+@@ -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@

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/01-fix_Makefile.in.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/02-add_mkinstalldirs.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/02-add_mkinstalldirs.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/02-add_mkinstalldirs.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/02-add_mkinstalldirs.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,161 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 02-add_mkinstalldirs.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: add mkinstalldirs
+
+ at DPATCH@
+diff -urNad complete.dpatch/mkinstalldirs /tmp/dpep.rSX3y1/complete.dpatch/mkinstalldirs
+--- complete.dpatch/mkinstalldirs	1970-01-01 01:00:00.000000000 +0100
++++ /tmp/dpep.rSX3y1/complete.dpatch/mkinstalldirs	2005-11-10 16:36:11.547841465 +0100
+@@ -0,0 +1,150 @@
++#! /bin/sh
++# mkinstalldirs --- make directory hierarchy
++
++scriptversion=2005-02-02.21
++
++# Original author: Noah Friedman <friedman at prep.ai.mit.edu>
++# Created: 1993-05-16
++# Public domain.
++#
++# This file is maintained in Automake, please report
++# bugs to <bug-automake at gnu.org> or send patches to
++# <automake-patches at gnu.org>.
++
++errstatus=0
++dirmode=""
++
++usage="\
++Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
++
++Create each directory DIR (with mode MODE, if specified), including all
++leading file name components.
++
++Report bugs to <bug-automake at gnu.org>."
++
++# process command line arguments
++while test $# -gt 0 ; do
++  case $1 in
++    -h | --help | --h*)         # -h for help
++      echo "$usage"
++      exit $?
++      ;;
++    -m)                         # -m PERM arg
++      shift
++      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
++      dirmode=$1
++      shift
++      ;;
++    --version)
++      echo "$0 $scriptversion"
++      exit $?
++      ;;
++    --)                         # stop option processing
++      shift
++      break
++      ;;
++    -*)                         # unknown option
++      echo "$usage" 1>&2
++      exit 1
++      ;;
++    *)                          # first non-opt arg
++      break
++      ;;
++  esac
++done
++
++for file
++do
++  if test -d "$file"; then
++    shift
++  else
++    break
++  fi
++done
++
++case $# in
++  0) exit 0 ;;
++esac
++
++# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
++# mkdir -p a/c at the same time, both will detect that a is missing,
++# one will create a, then the other will try to create a and die with
++# a "File exists" error.  This is a problem when calling mkinstalldirs
++# from a parallel make.  We use --version in the probe to restrict
++# ourselves to GNU mkdir, which is thread-safe.
++case $dirmode in
++  '')
++    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
++      echo "mkdir -p -- $*"
++      exec mkdir -p -- "$@"
++    else
++      # On NextStep and OpenStep, the `mkdir' command does not
++      # recognize any option.  It will interpret all options as
++      # directories to create, and then abort because `.' already
++      # exists.
++      test -d ./-p && rmdir ./-p
++      test -d ./--version && rmdir ./--version
++    fi
++    ;;
++  *)
++    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
++       test ! -d ./--version; then
++      echo "mkdir -m $dirmode -p -- $*"
++      exec mkdir -m "$dirmode" -p -- "$@"
++    else
++      # Clean up after NextStep and OpenStep mkdir.
++      for d in ./-m ./-p ./--version "./$dirmode";
++      do
++        test -d $d && rmdir $d
++      done
++    fi
++    ;;
++esac
++
++for file
++do
++  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
++  shift
++
++  pathcomp=
++  for d
++  do
++    pathcomp="$pathcomp$d"
++    case $pathcomp in
++      -*) pathcomp=./$pathcomp ;;
++    esac
++
++    if test ! -d "$pathcomp"; then
++      echo "mkdir $pathcomp"
++
++      mkdir "$pathcomp" || lasterr=$?
++
++      if test ! -d "$pathcomp"; then
++	errstatus=$lasterr
++      else
++	if test ! -z "$dirmode"; then
++	  echo "chmod $dirmode $pathcomp"
++	  lasterr=""
++	  chmod "$dirmode" "$pathcomp" || lasterr=$?
++
++	  if test ! -z "$lasterr"; then
++	    errstatus=$lasterr
++	  fi
++	fi
++      fi
++    fi
++
++    pathcomp="$pathcomp/"
++  done
++done
++
++exit $errstatus
++
++# Local Variables:
++# mode: shell-script
++# sh-indentation: 2
++# eval: (add-hook 'write-file-hooks 'time-stamp)
++# time-stamp-start: "scriptversion="
++# time-stamp-format: "%:y-%02m-%02d.%02H"
++# time-stamp-end: "$"
++# End:

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/02-add_mkinstalldirs.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/03-fix_docs.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/03-fix_docs.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/03-fix_docs.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/03-fix_docs.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,61 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+_# 03-fix_docs.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix FAQ and virtual domains installation docs
+
+ at DPATCH@
+diff -urNad complete.dpatch/doc/faq.html /tmp/dpep.kSS9gk/complete.dpatch/doc/faq.html
+--- complete.dpatch/doc/faq.html	2005-11-10 21:12:04.000000000 +0100
++++ /tmp/dpep.kSS9gk/complete.dpatch/doc/faq.html	2005-11-10 21:12:05.457868786 +0100
+@@ -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>
+ 
+diff -urNad complete.dpatch/doc/install-virtdomains.html /tmp/dpep.kSS9gk/complete.dpatch/doc/install-virtdomains.html
+--- complete.dpatch/doc/install-virtdomains.html	2005-11-10 21:12:04.000000000 +0100
++++ /tmp/dpep.kSS9gk/complete.dpatch/doc/install-virtdomains.html	2005-11-10 21:12:05.457868786 +0100
+@@ -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>
+ 
+diff -urNad complete.dpatch/lib/imapoptions /tmp/dpep.kSS9gk/complete.dpatch/lib/imapoptions
+--- complete.dpatch/lib/imapoptions	2005-11-10 21:12:04.000000000 +0100
++++ /tmp/dpep.kSS9gk/complete.dpatch/lib/imapoptions	2005-11-10 21:13:13.246208162 +0100
+@@ -184,7 +184,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. */
+@@ -436,7 +440,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

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/03-fix_docs.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/04-add_autogen.sh.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/04-add_autogen.sh.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/04-add_autogen.sh.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/04-add_autogen.sh.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,88 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 04-add_autogen.sh.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Add autogen.sh
+
+ at DPATCH@
+diff -urNad complete.dpatch/autogen.sh /tmp/dpep.kPXQsQ/complete.dpatch/autogen.sh
+--- complete.dpatch/autogen.sh	1970-01-01 01:00:00.000000000 +0100
++++ /tmp/dpep.kPXQsQ/complete.dpatch/autogen.sh	2005-11-10 16:41:07.825648811 +0100
+@@ -0,0 +1,77 @@
++#!/bin/sh
++#
++# autogen.sh glue for CMU Cyrus IMAP
++# $Id: autogen.sh,v 1.16 2004/09/12 15:30:23 hmh Exp $
++#
++# Requires: automake 1.9, autoconf 2.57, dpkg-dev
++set -e
++
++# Refresh GNU autotools toolchain.
++echo Running GNU autotools toolchain...
++AUTOMAKEDIR=/usr/share/automake-1.9
++[ -n "$AUTOMAKEDIR" ] &&
++  for i in config.guess config.sub install-sh mkinstalldirs ; do
++	test -r ${AUTOMAKEDIR}/${i} && {
++		rm -f ${i} || true
++		cp ${AUTOMAKEDIR}/${i} .
++	}
++	chmod 755 ${i}
++  done
++
++aclocal-1.9 -I cmulocal
++autoheader
++#automake --verbose --foreign --add-missing
++autoconf
++
++# For the Debian build
++test -d debian && {
++	# Kill executable list first
++	rm -f debian/executable.files
++
++	# Make sure our executable and removable lists won't be screwed up
++	debclean && echo Cleaned buildtree just in case...
++
++	# refresh list of executable scripts, to avoid possible breakage if
++	# upstream tarball does not include the file or if it is mispackaged
++	# for whatever reason.
++	echo Generating list of executable files...
++	rm -f debian/executable.files
++	find -type f -perm +111 ! -name '.*' -print  | sort > debian/executable.files
++
++	# even in Debian builds, copy them in, don't link them
++	rm -f config.sub config.guess
++	cp /usr/share/misc/config.sub .
++	cp /usr/share/misc/config.guess .
++
++	# Remove any files in upstream tarball that we don't have in the Debian
++	# package (because diff cannot remove files)
++	# THIS CRAP IS NOT EMBEDDED SPACE-SAFE!
++	version=`dpkg-parsechangelog | awk '/Version:/ { print $2 }' | sed -e 's/-[^-]\+$//'`
++	source=`dpkg-parsechangelog | awk '/Source:/ { print $2 }' | tr -d ' '`
++	if test -r ../${source}_${version}.orig.tar.gz ; then
++		echo Generating list of files that should be removed...
++		rm -f debian/deletable.files
++		touch debian/deletable.files.new
++		mkdir debian/tmp
++		cd debian/tmp
++		tar -zxf ../../../${source}_${version}.orig.tar.gz
++		# et/ we handle directly
++		rm -fr */et/
++		cd ../..
++		for i in `find debian/tmp/ -type f ! -name '.*' -print | xargs` ; do
++		  if test -r ${i} ; then
++		     filename=`echo "${i}" | sed -e 's#.*debian/tmp/[^/]+/##'`
++		     test -r "${filename}" || echo "${filename}" >>debian/deletable.files.new
++		  fi
++		done
++		sort < debian/deletable.files.new > debian/deletable.files \
++			&& rm debian/deletable.files.new
++		rm -fr debian/tmp
++	else
++		echo Emptying list of files that should be deleted...
++		rm -f debian/deletable.files
++		touch debian/deletable.files
++	fi
++}
++
++exit 0

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/04-add_autogen.sh.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/05-fix_programnames.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/05-fix_programnames.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/05-fix_programnames.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/05-fix_programnames.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,579 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 05-fix_programnames_in_manpages.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: fix some minor things in manpages, fix program names in manpages and
+## DP: program sources
+
+ at DPATCH@
+diff -urNad complete.dpatch/imap/deliver.c /tmp/dpep.8HKnp3/complete.dpatch/imap/deliver.c
+--- complete.dpatch/imap/deliver.c	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/imap/deliver.c	2005-11-11 15:34:00.393958651 +0100
+@@ -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);
+diff -urNad complete.dpatch/imap/quota.c /tmp/dpep.8HKnp3/complete.dpatch/imap/quota.c
+--- complete.dpatch/imap/quota.c	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/imap/quota.c	2005-11-11 15:34:00.393958651 +0100
+@@ -196,7 +196,7 @@
+ 
+ void usage(void)
+ {
+-    fprintf(stderr, "usage: quota [-C <alt_config>] [-d <domain>] [-f] [prefix]...\n");
++    fprintf(stderr, "usage: cyrquota [-C <alt_config>] [-d <domain>] [-f] [prefix]...\n");
+     exit(EC_USAGE);
+ }    
+ 
+diff -urNad complete.dpatch/imap/reconstruct.c /tmp/dpep.8HKnp3/complete.dpatch/imap/reconstruct.c
+--- complete.dpatch/imap/reconstruct.c	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/imap/reconstruct.c	2005-11-11 15:34:00.394958554 +0100
+@@ -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);
+ }    
+ 
+diff -urNad complete.dpatch/man/chk_cyrus.8 /tmp/dpep.8HKnp3/complete.dpatch/man/chk_cyrus.8
+--- complete.dpatch/man/chk_cyrus.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/chk_cyrus.8	2005-11-11 15:34:00.394958554 +0100
+@@ -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
+diff -urNad complete.dpatch/man/ctl_cyrusdb.8 /tmp/dpep.8HKnp3/complete.dpatch/man/ctl_cyrusdb.8
+--- complete.dpatch/man/ctl_cyrusdb.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/ctl_cyrusdb.8	2005-11-11 15:34:00.394958554 +0100
+@@ -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
+diff -urNad complete.dpatch/man/ctl_deliver.8 /tmp/dpep.8HKnp3/complete.dpatch/man/ctl_deliver.8
+--- complete.dpatch/man/ctl_deliver.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/ctl_deliver.8	2005-11-11 15:34:00.395958456 +0100
+@@ -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
+diff -urNad complete.dpatch/man/ctl_mboxlist.8 /tmp/dpep.8HKnp3/complete.dpatch/man/ctl_mboxlist.8
+--- complete.dpatch/man/ctl_mboxlist.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/ctl_mboxlist.8	2005-11-11 15:34:00.395958456 +0100
+@@ -138,4 +138,4 @@
+ .B /etc/imapd.conf
+ .SH SEE ALSO
+ .PP
+-\fBimapd.conf(5)\fR, \fBmaster(8)\fR
++\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR
+diff -urNad complete.dpatch/man/cyr_expire.8 /tmp/dpep.8HKnp3/complete.dpatch/man/cyr_expire.8
+--- complete.dpatch/man/cyr_expire.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/cyr_expire.8	2005-11-11 15:34:00.395958456 +0100
+@@ -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
+diff -urNad complete.dpatch/man/cyrus.conf.5 /tmp/dpep.8HKnp3/complete.dpatch/man/cyrus.conf.5
+--- complete.dpatch/man/cyrus.conf.5	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/cyrus.conf.5	2005-11-11 15:34:00.396958358 +0100
+@@ -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
+diff -urNad complete.dpatch/man/deliver.8 /tmp/dpep.8HKnp3/complete.dpatch/man/deliver.8
+--- complete.dpatch/man/deliver.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/deliver.8	2005-11-11 15:34:00.396958358 +0100
+@@ -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
+diff -urNad complete.dpatch/man/fud.8 /tmp/dpep.8HKnp3/complete.dpatch/man/fud.8
+--- complete.dpatch/man/fud.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/fud.8	2005-11-11 15:34:00.396958358 +0100
+@@ -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.
+diff -urNad complete.dpatch/man/idled.8 /tmp/dpep.8HKnp3/complete.dpatch/man/idled.8
+--- complete.dpatch/man/idled.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/idled.8	2005-11-11 15:34:00.397958261 +0100
+@@ -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
+diff -urNad complete.dpatch/man/imapd.8 /tmp/dpep.8HKnp3/complete.dpatch/man/imapd.8
+--- complete.dpatch/man/imapd.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/imapd.8	2005-11-11 15:34:00.397958261 +0100
+@@ -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
+diff -urNad complete.dpatch/man/lmtpd.8 /tmp/dpep.8HKnp3/complete.dpatch/man/lmtpd.8
+--- complete.dpatch/man/lmtpd.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/lmtpd.8	2005-11-11 15:34:00.397958261 +0100
+@@ -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
+diff -urNad complete.dpatch/man/master.8 /tmp/dpep.8HKnp3/complete.dpatch/man/master.8
+--- complete.dpatch/man/master.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/master.8	2005-11-11 15:34:00.398958163 +0100
+@@ -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,
+diff -urNad complete.dpatch/man/nntpd.8 /tmp/dpep.8HKnp3/complete.dpatch/man/nntpd.8
+--- complete.dpatch/man/nntpd.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/nntpd.8	2005-11-11 15:34:00.398958163 +0100
+@@ -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
+diff -urNad complete.dpatch/man/notifyd.8 /tmp/dpep.8HKnp3/complete.dpatch/man/notifyd.8
+--- complete.dpatch/man/notifyd.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/notifyd.8	2005-11-11 15:34:00.398958163 +0100
+@@ -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
+diff -urNad complete.dpatch/man/pop3d.8 /tmp/dpep.8HKnp3/complete.dpatch/man/pop3d.8
+--- complete.dpatch/man/pop3d.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/pop3d.8	2005-11-11 15:34:00.399958065 +0100
+@@ -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
+diff -urNad complete.dpatch/man/quota.8 /tmp/dpep.8HKnp3/complete.dpatch/man/quota.8
+--- complete.dpatch/man/quota.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/quota.8	2005-11-11 15:34:00.399958065 +0100
+@@ -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.
+diff -urNad complete.dpatch/man/reconstruct.8 /tmp/dpep.8HKnp3/complete.dpatch/man/reconstruct.8
+--- complete.dpatch/man/reconstruct.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/reconstruct.8	2005-11-11 15:34:00.399958065 +0100
+@@ -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.
+diff -urNad complete.dpatch/man/smmapd.8 /tmp/dpep.8HKnp3/complete.dpatch/man/smmapd.8
+--- complete.dpatch/man/smmapd.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/smmapd.8	2005-11-11 15:34:00.400957968 +0100
+@@ -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
+diff -urNad complete.dpatch/man/timsieved.8 /tmp/dpep.8HKnp3/complete.dpatch/man/timsieved.8
+--- complete.dpatch/man/timsieved.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/timsieved.8	2005-11-11 15:34:00.400957968 +0100
+@@ -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
+diff -urNad complete.dpatch/man/tls_prune.8 /tmp/dpep.8HKnp3/complete.dpatch/man/tls_prune.8
+--- complete.dpatch/man/tls_prune.8	2005-11-11 15:33:59.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/man/tls_prune.8	2005-11-11 15:34:00.400957968 +0100
+@@ -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
+diff -urNad complete.dpatch/sieve/md5.c /tmp/dpep.8HKnp3/complete.dpatch/sieve/md5.c
+--- complete.dpatch/sieve/md5.c	2000-01-05 05:51:51.000000000 +0100
++++ /tmp/dpep.8HKnp3/complete.dpatch/sieve/md5.c	2005-11-11 15:34:48.633248090 +0100
+@@ -31,7 +31,7 @@
+ 
+ #include "md5global.h"
+ #include "md5.h"
+-#include "hmac-md5.h"
++#include "sasl/hmac-md5.h"
+ 
+ /* Constants for MD5Transform routine.
+ */

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/05-fix_programnames.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/06-disable_runpath.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/06-disable_runpath.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/06-disable_runpath.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/06-disable_runpath.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,38 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 06-disable_runpath.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: disable runpath
+
+ at DPATCH@
+diff -urNad complete.dpatch/cmulocal/cyrus.m4 /tmp/dpep.1tmcI8/complete.dpatch/cmulocal/cyrus.m4
+--- complete.dpatch/cmulocal/cyrus.m4	2003-10-08 22:35:24.000000000 +0200
++++ /tmp/dpep.1tmcI8/complete.dpatch/cmulocal/cyrus.m4	2005-11-10 18:33:44.832750394 +0100
+@@ -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"
++])

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/06-disable_runpath.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/07-update_aclocal_and_configure.in.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/07-update_aclocal_and_configure.in.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/07-update_aclocal_and_configure.in.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/07-update_aclocal_and_configure.in.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,1926 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 07-update_aclocal.m4.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: update aclocal.m4 and configure.in
+
+ at DPATCH@
+diff -urNad complete.dpatch/aclocal.m4 /tmp/dpep.IJ03bC/complete.dpatch/aclocal.m4
+--- complete.dpatch/aclocal.m4	2005-02-14 18:59:22.000000000 +0100
++++ /tmp/dpep.IJ03bC/complete.dpatch/aclocal.m4	2005-11-10 18:42:30.706082197 +0100
+@@ -1,7 +1,7 @@
+-# generated automatically by aclocal 1.7.2 -*- Autoconf -*-
++# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
+ 
+-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
+-# Free Software Foundation, Inc.
++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
++# 2005  Free Software Foundation, Inc.
+ # This file is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+@@ -11,1850 +11,12 @@
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ # PARTICULAR PURPOSE.
+ 
+-# isc-posix.m4 serial 2 (gettext-0.11.2)
+-dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
+-dnl This file is free software, distributed under the terms of the GNU
+-dnl General Public License.  As a special exception to the GNU General
+-dnl Public License, this file may be distributed as part of a program
+-dnl that contains a configuration script generated by Autoconf, under
+-dnl the same distribution terms as the rest of that program.
+-
+-# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
+-
+-# This test replaces the one in autoconf.
+-# Currently this macro should have the same name as the autoconf macro
+-# because gettext's gettext.m4 (distributed in the automake package)
+-# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
+-# give these diagnostics:
+-#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
+-#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
+-
+-undefine([AC_ISC_POSIX])
+-
+-AC_DEFUN([AC_ISC_POSIX],
+-  [
+-    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
+-    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
+-  ]
+-)
+-
+-dnl
+-dnl $Id: c-attribute.m4,v 1.3 2003/10/08 20:35:24 rjs3 Exp $
+-dnl
+-
+-dnl
+-dnl Test for __attribute__
+-dnl
+-
+-AC_DEFUN([CMU_C___ATTRIBUTE__], [
+-AC_MSG_CHECKING(for __attribute__)
+-AC_CACHE_VAL(ac_cv___attribute__, [
+-AC_TRY_COMPILE([
+-#include <stdlib.h>
+-],
+-[
+-static void foo(void) __attribute__ ((noreturn));
+-
+-static void
+-foo(void)
+-{
+-  exit(1);
+-}
+-],
+-ac_cv___attribute__=yes,
+-ac_cv___attribute__=no)])
+-if test "$ac_cv___attribute__" = "yes"; then
+-  AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
+-fi
+-AC_MSG_RESULT($ac_cv___attribute__)
+-])
+-
+-
+-dnl
+-dnl $Id: c-fpic.m4,v 1.2 2003/10/08 20:35:24 rjs3 Exp $
+-dnl
+-
+-dnl
+-dnl Test for -fPIC
+-dnl
+-
+-AC_DEFUN([CMU_C_FPIC], [
+-AC_MSG_CHECKING(if compiler supports -fPIC)
+-AC_CACHE_VAL(ac_cv_fpic, [
+-save_CFLAGS=$CFLAGS
+-CFLAGS="${CFLAGS} -fPIC"
+-AC_TRY_COMPILE([
+-#include <stdlib.h>
+-],
+-[
+-static void
+-foo(void)
+-{
+-  exit(1);
+-}
+-],
+-ac_cv_fpic=yes,
+-ac_cv_fpic=no)
+-CFLAGS=$save_CFLAGS
+-])
+-if test "$ac_cv_fpic" = "yes"; then
+-    FPIC_CFLAGS="-fPIC"
+-else
+-    FPIC_CFLAGS=""
+-fi
+-AC_MSG_RESULT($ac_cv_fpic)
+-])
+-
+-
+-dnl
+-dnl Additional macros for configure.in packaged up for easier theft.
+-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 It would be good if ANDREW_ADD_LIBPATH could detect if something was
+-dnl already there and not redundantly add it if it is.
+-
+-dnl add -L(arg), and possibly (runpath switch)(arg), to LDFLAGS
+-dnl (so the runpath for shared libraries is set).
+-AC_DEFUN([CMU_ADD_LIBPATH], [
+-  # this is CMU ADD LIBPATH
+-  if test "$andrew_runpath_switch" = "none" ; then
+-	LDFLAGS="-L$1 ${LDFLAGS}"
+-  else
+-	LDFLAGS="-L$1 $andrew_runpath_switch$1 ${LDFLAGS}"
+-  fi
+-])
+-
+-dnl add -L(1st arg), and possibly (runpath switch)(1st arg), to (2nd arg)
+-dnl (so the runpath for shared libraries is set).
+-AC_DEFUN([CMU_ADD_LIBPATH_TO], [
+-  # this is CMU ADD LIBPATH TO
+-  if test "$andrew_runpath_switch" = "none" ; then
+-	$2="-L$1 ${$2}"
+-  else
+-	$2="-L$1 ${$2} $andrew_runpath_switch$1"
+-  fi
+-])
+-
+-dnl runpath initialization
+-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}"
+-  ])])
+-
+-dnl bsd_sockets.m4--which socket libraries do we need? 
+-dnl Derrick Brashear
+-dnl from Zephyr
+-dnl $Id: bsd_sockets.m4,v 1.9 2003/10/08 20:35:24 rjs3 Exp $
+-
+-dnl Hacked on by Rob Earhart to not just toss stuff in LIBS
+-dnl It now puts everything required for sockets into LIB_SOCKET
+-
+-AC_DEFUN([CMU_SOCKETS], [
+-	save_LIBS="$LIBS"
+-	LIB_SOCKET=""
+-	AC_CHECK_FUNC(connect, :,
+-		AC_CHECK_LIB(nsl, gethostbyname,
+-			     LIB_SOCKET="-lnsl $LIB_SOCKET")
+-		AC_CHECK_LIB(socket, connect,
+-			     LIB_SOCKET="-lsocket $LIB_SOCKET")
+-	)
+-	LIBS="$LIB_SOCKET $save_LIBS"
+-	AC_CHECK_FUNC(res_search, :,
+-                AC_CHECK_LIB(resolv, res_search,
+-                              LIB_SOCKET="-lresolv $LIB_SOCKET") 
+-        )
+-	LIBS="$LIB_SOCKET $save_LIBS"
+-	AC_CHECK_FUNCS(dn_expand dns_lookup)
+-	LIBS="$save_LIBS"
+-	AC_SUBST(LIB_SOCKET)
+-	])
+-
+-dnl See whether we can use IPv6 related functions
+-dnl contributed by Hajimu UMEMOTO
+-
+-AC_DEFUN([IPv6_CHECK_FUNC], [
+-AC_CHECK_FUNC($1, [dnl
+-  ac_cv_lib_socket_$1=no
+-  ac_cv_lib_inet6_$1=no
+-], [dnl
+-  AC_CHECK_LIB(socket, $1, [dnl
+-    LIBS="$LIBS -lsocket"
+-    ac_cv_lib_inet6_$1=no
+-  ], [dnl
+-    AC_MSG_CHECKING([whether your system has IPv6 directory])
+-    AC_CACHE_VAL(ipv6_cv_dir, [dnl
+-      for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
+-	if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then
+-	  break
+-	fi
+-      done])dnl
+-    AC_MSG_RESULT($ipv6_cv_dir)
+-    if test $ipv6_cv_dir = no; then
+-      ac_cv_lib_inet6_$1=no
+-    else
+-      if test x$ipv6_libinet6 = x; then
+-	ipv6_libinet6=no
+-	SAVELDFLAGS="$LDFLAGS"
+-	LDFLAGS="$LDFLAGS -L$ipv6_cv_dir/lib"
+-      fi
+-      AC_CHECK_LIB(inet6, $1, [dnl
+-	if test $ipv6_libinet6 = no; then
+-	  ipv6_libinet6=yes
+-	  LIBS="$LIBS -linet6"
+-	fi],)dnl
+-      if test $ipv6_libinet6 = no; then
+-	LDFLAGS="$SAVELDFLAGS"
+-      fi
+-    fi])dnl
+-])dnl
+-ipv6_cv_$1=no
+-if test $ac_cv_func_$1 = yes -o $ac_cv_lib_socket_$1 = yes \
+-     -o $ac_cv_lib_inet6_$1 = yes
+-then
+-  ipv6_cv_$1=yes
+-fi
+-if test $ipv6_cv_$1 = no; then
+-  if test $1 = getaddrinfo; then
+-    for ipv6_cv_pfx in o n; do
+-      AC_EGREP_HEADER(${ipv6_cv_pfx}$1, netdb.h,
+-		      [AC_CHECK_FUNC(${ipv6_cv_pfx}$1)])
+-      if eval test X\$ac_cv_func_${ipv6_cv_pfx}$1 = Xyes; then
+-        AC_DEFINE(HAVE_GETADDRINFO,[],[Do we have a getaddrinfo?])
+-        ipv6_cv_$1=yes
+-        break
+-      fi
+-    done
+-  fi
+-fi
+-if test $ipv6_cv_$1 = yes; then
+-  ifelse([$2], , :, [$2])
+-else
+-  ifelse([$3], , :, [$3])
+-fi])
+-
+-
+-dnl See whether we have ss_family in sockaddr_storage
+-AC_DEFUN([IPv6_CHECK_SS_FAMILY], [
+-AC_MSG_CHECKING([whether you have ss_family in struct sockaddr_storage])
+-AC_CACHE_VAL(ipv6_cv_ss_family, [dnl
+-AC_TRY_COMPILE([#include <sys/types.h>
+-#include <sys/socket.h>],
+-	[struct sockaddr_storage ss; int i = ss.ss_family;],
+-	[ipv6_cv_ss_family=yes], [ipv6_cv_ss_family=no])])dnl
+-if test $ipv6_cv_ss_family = yes; then
+-  ifelse([$1], , AC_DEFINE(HAVE_SS_FAMILY,[],[Is there an ss_family in sockaddr_storage?]), [$1])
+-else
+-  ifelse([$2], , :, [$2])
+-fi
+-AC_MSG_RESULT($ipv6_cv_ss_family)])
+-
+-
+-dnl whether you have sa_len in struct sockaddr
+-AC_DEFUN([IPv6_CHECK_SA_LEN], [
+-AC_MSG_CHECKING([whether you have sa_len in struct sockaddr])
+-AC_CACHE_VAL(ipv6_cv_sa_len, [dnl
+-AC_TRY_COMPILE([#include <sys/types.h>
+-#include <sys/socket.h>],
+-	       [struct sockaddr sa; int i = sa.sa_len;],
+-	       [ipv6_cv_sa_len=yes], [ipv6_cv_sa_len=no])])dnl
+-if test $ipv6_cv_sa_len = yes; then
+-  ifelse([$1], , AC_DEFINE(HAVE_SOCKADDR_SA_LEN,[],[Does sockaddr have an sa_len?]), [$1])
+-else
+-  ifelse([$2], , :, [$2])
+-fi
+-AC_MSG_RESULT($ipv6_cv_sa_len)])
+-
+-
+-dnl See whether sys/socket.h has socklen_t
+-AC_DEFUN([IPv6_CHECK_SOCKLEN_T], [
+-AC_MSG_CHECKING(for socklen_t)
+-AC_CACHE_VAL(ipv6_cv_socklen_t, [dnl
+-AC_TRY_LINK([#include <sys/types.h>
+-#include <sys/socket.h>],
+-	    [socklen_t len = 0;],
+-	    [ipv6_cv_socklen_t=yes], [ipv6_cv_socklen_t=no])])dnl
+-if test $ipv6_cv_socklen_t = yes; then
+-  ifelse([$1], , AC_DEFINE(HAVE_SOCKLEN_T,[],[Do we have a socklen_t?]), [$1])
+-else
+-  ifelse([$2], , :, [$2])
+-fi
+-AC_MSG_RESULT($ipv6_cv_socklen_t)])
+-
+-
+-dnl $Id: berkdb.m4,v 1.19 2005/01/06 20:24:52 shadow Exp $
+-
+-AC_DEFUN([CMU_DB_INC_WHERE1], [
+-saved_CPPFLAGS=$CPPFLAGS
+-CPPFLAGS="$saved_CPPFLAGS -I$1"
+-AC_TRY_COMPILE([#include <db.h>],
+-[DB *db;
+-db_create(&db, NULL, 0);
+-db->open(db, "foo.db", NULL, DB_UNKNOWN, DB_RDONLY, 0644);],
+-ac_cv_found_db_inc=yes,
+-ac_cv_found_db_inc=no)
+-CPPFLAGS=$saved_CPPFLAGS
+-])
+-
+-AC_DEFUN([CMU_DB_INC_WHERE], [
+-   for i in $1; do
+-      AC_MSG_CHECKING(for db headers in $i)
+-      CMU_DB_INC_WHERE1($i)
+-      CMU_TEST_INCPATH($i, db)
+-      if test "$ac_cv_found_db_inc" = "yes"; then
+-        ac_cv_db_where_inc=$i
+-        AC_MSG_RESULT(found)
+-        break
+-      else
+-        AC_MSG_RESULT(not found)
+-      fi
+-    done
+-])
+-
+-#
+-# Test for lib files
+-#
+-
+-AC_DEFUN([CMU_DB3_LIB_WHERE1], [
+-AC_REQUIRE([CMU_AFS])
+-AC_REQUIRE([CMU_KRB4])
+-saved_LIBS=$LIBS
+-  LIBS="$saved_LIBS -L$1 -ldb-3"
+-AC_TRY_LINK([#include <db.h>],
+-[db_env_create(NULL, 0);],
+-[ac_cv_found_db_3_lib=yes],
+-ac_cv_found_db_3_lib=no)
+-LIBS=$saved_LIBS
+-])
+-AC_DEFUN([CMU_DB4_LIB_WHERE1], [
+-AC_REQUIRE([CMU_AFS])
+-AC_REQUIRE([CMU_KRB4])
+-saved_LIBS=$LIBS
+-LIBS="$saved_LIBS -L$1 -ldb-4"
+-AC_TRY_LINK([#include <db.h>],
+-[db_env_create(NULL, 0);],
+-[ac_cv_found_db_4_lib=yes],
+-ac_cv_found_db_4_lib=no)
+-LIBS=$saved_LIBS
+-])
+-
+-AC_DEFUN([CMU_DB_LIB_WHERE], [
+-   for i in $1; do
+-      AC_MSG_CHECKING(for db libraries in $i)
+-if test "$enable_db4" = "yes"; then
+-      CMU_DB4_LIB_WHERE1($i)
+-      CMU_TEST_LIBPATH($i, [db-4])
+-      ac_cv_found_db_lib=$ac_cv_found_db_4_lib
+-else
+-      CMU_DB3_LIB_WHERE1($i)
+-      CMU_TEST_LIBPATH($i, [db-3])
+-      ac_cv_found_db_lib=$ac_cv_found_db_3_lib
+-fi
+-      if test "$ac_cv_found_db_lib" = "yes" ; then
+-        ac_cv_db_where_lib=$i
+-        AC_MSG_RESULT(found)
+-        break
+-      else
+-        AC_MSG_RESULT(not found)
+-      fi
+-    done
+-])
+-
+-AC_DEFUN([CMU_USE_DB], [
+-AC_ARG_WITH(db,
+-	[  --with-db=PREFIX      Compile with db support],
+-	[if test "X$with_db" = "X"; then
+-		with_db=yes
+-	fi])
+-AC_ARG_WITH(db-lib,
+-	[  --with-db-lib=dir     use db libraries in dir],
+-	[if test "$withval" = "yes" -o "$withval" = "no"; then
+-		AC_MSG_ERROR([No argument for --with-db-lib])
+-	fi])
+-AC_ARG_WITH(db-include,
+-	[  --with-db-include=dir use db headers in dir],
+-	[if test "$withval" = "yes" -o "$withval" = "no"; then
+-		AC_MSG_ERROR([No argument for --with-db-include])
+-	fi])
+-AC_ARG_ENABLE(db4,
+-	[  --enable-db4          use db 4.x libraries])
+-	
+-	if test "X$with_db" != "X"; then
+-	  if test "$with_db" != "yes"; then
+-	    ac_cv_db_where_lib=$with_db/lib
+-	    ac_cv_db_where_inc=$with_db/include
+-	  fi
+-	fi
+-
+-	if test "X$with_db_lib" != "X"; then
+-	  ac_cv_db_where_lib=$with_db_lib
+-	fi
+-	if test "X$ac_cv_db_where_lib" = "X"; then
+-	  CMU_DB_LIB_WHERE(/usr/athena/lib /usr/lib /usr/local/lib)
+-	fi
+-
+-	if test "X$with_db_include" != "X"; then
+-	  ac_cv_db_where_inc=$with_db_include
+-	fi
+-	if test "X$ac_cv_db_where_inc" = "X"; then
+-	  CMU_DB_INC_WHERE(/usr/athena/include /usr/local/include)
+-	fi
+-
+-	AC_MSG_CHECKING(whether to include db)
+-	if test "X$ac_cv_db_where_lib" = "X" -o "X$ac_cv_db_where_inc" = "X"; then
+-	  ac_cv_found_db=no
+-	  AC_MSG_RESULT(no)
+-	else
+-	  ac_cv_found_db=yes
+-	  AC_MSG_RESULT(yes)
+-	  DB_INC_DIR=$ac_cv_db_where_inc
+-	  DB_LIB_DIR=$ac_cv_db_where_lib
+-	  DB_INC_FLAGS="-I${DB_INC_DIR}"
+-          if test "$enable_db4" = "yes"; then
+-	     DB_LIB_FLAGS="-L${DB_LIB_DIR} -ldb-4"
+-          else
+-	     DB_LIB_FLAGS="-L${DB_LIB_DIR} -ldb-3"
+-          fi
+-          dnl Do not force configure.in to put these in CFLAGS and LIBS unconditionally
+-          dnl Allow makefile substitutions....
+-          AC_SUBST(DB_INC_FLAGS)
+-          AC_SUBST(DB_LIB_FLAGS)
+-	  if test "X$RPATH" = "X"; then
+-		RPATH=""
+-	  fi
+-	  case "${host}" in
+-	    *-*-linux*)
+-	      if test "X$RPATH" = "X"; then
+-	        RPATH="-Wl,-rpath,${DB_LIB_DIR}"
+-	      else 
+-		RPATH="${RPATH}:${DB_LIB_DIR}"
+-	      fi
+-	      ;;
+-	    *-*-hpux*)
+-	      if test "X$RPATH" = "X"; then
+-	        RPATH="-Wl,+b${DB_LIB_DIR}"
+-	      else 
+-		RPATH="${RPATH}:${DB_LIB_DIR}"
+-	      fi
+-	      ;;
+-	    *-*-irix*)
+-	      if test "X$RPATH" = "X"; then
+-	        RPATH="-Wl,-rpath,${DB_LIB_DIR}"
+-	      else 
+-		RPATH="${RPATH}:${DB_LIB_DIR}"
+-	      fi
+-	      ;;
+-	    *-*-solaris2*)
+-	      if test "$ac_cv_prog_gcc" = yes; then
+-		if test "X$RPATH" = "X"; then
+-		  RPATH="-Wl,-R${DB_LIB_DIR}"
+-		else 
+-		  RPATH="${RPATH}:${DB_LIB_DIR}"
+-		fi
+-	      else
+-	        RPATH="${RPATH} -R${DB_LIB_DIR}"
+-	      fi
+-	      ;;
+-	  esac
+-	  AC_SUBST(RPATH)
+-	fi
+-	])
+-
+-
+-
+-dnl ---- CUT HERE ---
+-
+-dnl These are the Cyrus Berkeley DB macros.  In an ideal world these would be
+-dnl identical to the above.
+-
+-dnl They are here so that they can be shared between Cyrus IMAPd
+-dnl and Cyrus SASL with relative ease.
+-
+-dnl The big difference between this and the ones above is that we don't assume
+-dnl that we know the name of the library, and we try a lot of permutations
+-dnl instead.  We also assume that DB4 is acceptable.
+-
+-dnl When we're done, there will be a BDB_LIBADD and a BDB_INCADD which should
+-dnl be used when necessary.  We should probably be smarter about our RPATH
+-dnl handling.
+-
+-dnl Call these with BERKELEY_DB_CHK.
+-
+-dnl We will also set $dblib to "berkeley" if we are successful, "no" otherwise.
+-
+-dnl this is unbelievably painful due to confusion over what db-3 should be
+-dnl named and where the db-3 header file is located.  arg.
+-AC_DEFUN([CYRUS_BERKELEY_DB_CHK_LIB],
+-[
+-	BDB_SAVE_LDFLAGS=$LDFLAGS
+-
+-	if test -d $with_bdb_lib; then
+-	    CMU_ADD_LIBPATH_TO($with_bdb_lib, LDFLAGS)
+-	    CMU_ADD_LIBPATH_TO($with_bdb_lib, BDB_LIBADD)
+-	else
+-	    BDB_LIBADD=""
+-	fi
+-
+-	saved_LIBS=$LIBS
+-        for dbname in db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 db3.2 db32 db-3.1 db3.1 db31 db-3 db30 db3 db
+-          do
+-	    LIBS="$saved_LIBS -l$dbname"
+-	    AC_TRY_LINK([#include <db.h>],
+-	    [db_create(NULL, NULL, 0);],
+-	    BDB_LIBADD="$BDB_LIBADD -l$dbname"; dblib="berkeley"; dbname=db,
+-            dblib="no")
+-	    if test "$dblib" = "berkeley"; then break; fi
+-          done
+-        if test "$dblib" = "no"; then
+-	    LIBS="$saved_LIBS -ldb"
+-	    AC_TRY_LINK([#include <db.h>],
+-	    [db_open(NULL, 0, 0, 0, NULL, NULL, NULL);],
+-	    BDB_LIBADD="$BDB_LIBADD -ldb"; dblib="berkeley"; dbname=db,
+-            dblib="no")
+-        fi
+-	LIBS=$saved_LIBS
+-
+-	LDFLAGS=$BDB_SAVE_LDFLAGS
+-])
+-
+-AC_DEFUN([CYRUS_BERKELEY_DB_OPTS],
+-[
+-AC_ARG_WITH(bdb-libdir,
+-	[  --with-bdb-libdir=DIR   Berkeley DB lib files are in DIR],
+-	with_bdb_lib=$withval,
+-	[ test "${with_bdb_lib+set}" = set || with_bdb_lib=none])
+-AC_ARG_WITH(bdb-incdir,
+-	[  --with-bdb-incdir=DIR   Berkeley DB include files are in DIR],
+-	with_bdb_inc=$withval,
+-	[ test "${with_bdb_inc+set}" = set || with_bdb_inc=none ])
+-])
+-
+-AC_DEFUN([CYRUS_BERKELEY_DB_CHK],
+-[
+-	AC_REQUIRE([CYRUS_BERKELEY_DB_OPTS])
+-
+-	cmu_save_CPPFLAGS=$CPPFLAGS
+-
+-	if test -d $with_bdb_inc; then
+-	    CPPFLAGS="$CPPFLAGS -I$with_bdb_inc"
+-	    BDB_INCADD="-I$with_bdb_inc"
+-	else
+-	    BDB_INCADD=""
+-	fi
+-
+-	dnl Note that FreeBSD puts it in a wierd place
+-        dnl (but they should use with-bdb-incdir)
+-        AC_CHECK_HEADER(db.h,
+-                        [CYRUS_BERKELEY_DB_CHK_LIB()],
+-                        dblib="no")
+-
+-	CPPFLAGS=$cmu_save_CPPFLAGS
+-])
+-
+-dnl $Id: common.m4,v 1.11 2003/10/08 20:35:24 rjs3 Exp $
+-
+-AC_DEFUN([CMU_TEST_LIBPATH], [
+-changequote(<<, >>)
+-define(<<CMU_AC_CV_FOUND>>, translit(ac_cv_found_$2_lib, <<- *>>, <<__p>>))
+-changequote([, ])
+-if test "$CMU_AC_CV_FOUND" = "yes"; then
+-  if test \! -r "$1/lib$2.a" -a \! -r "$1/lib$2.so" -a \! -r "$1/lib$2.sl"; then
+-    CMU_AC_CV_FOUND=no
+-  fi
+-fi
+-])
+-
+-AC_DEFUN([CMU_TEST_INCPATH], [
+-changequote(<<, >>)
+-define(<<CMU_AC_CV_FOUND>>, translit(ac_cv_found_$2_inc, [ *], [_p]))
+-changequote([, ])
+-if test "$CMU_AC_CV_FOUND" = "yes"; then
+-  if test \! -r "$1/$2.h"; then
+-    CMU_AC_CV_FOUND=no
+-  fi
+-fi
+-])
+-
+-dnl CMU_CHECK_HEADER_NOCACHE(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+-AC_DEFUN([CMU_CHECK_HEADER_NOCACHE],
+-[dnl Do the transliteration at runtime so arg 1 can be a shell variable.
+-ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
+-AC_MSG_CHECKING([for $1])
+-AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes",
+-  eval "ac_cv_header_$ac_safe=no")
+-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+-  AC_MSG_RESULT(yes)
+-  ifelse([$2], , :, [$2])
+-else
+-  AC_MSG_RESULT(no)
+-ifelse([$3], , , [$3
+-])dnl
+-fi
+-])
+-
+-dnl afs.m4--AFS libraries, includes, and dependencies
+-dnl $Id: afs.m4,v 1.28 2004/04/29 22:00:07 cg2v Exp $
+-dnl Chaskiel Grundman
+-dnl based on kerberos_v4.m4
+-dnl Derrick Brashear
+-dnl from KTH krb and Arla
+-
+-AC_DEFUN([CMU_AFS_INC_WHERE1], [
+-cmu_save_CPPFLAGS=$CPPFLAGS
+-CPPFLAGS="$cmu_save_CPPFLAGS -I$1"
+-AC_TRY_COMPILE([#include <afs/param.h>],
+-[#ifndef SYS_NAME
+-choke me
+-#endif
+-int foo;],
+-ac_cv_found_afs_inc=yes,
+-ac_cv_found_afs_inc=no)
+-CPPFLAGS=$cmu_save_CPPFLAGS
+-])
+-
+-AC_DEFUN([CMU_AFS_LIB_WHERE1], [
+-save_LIBS="$LIBS"
+-save_LDFLAGS="$LDFLAGS"
+-
+-LIBS="-lauth $1/afs/util.a $LIB_SOCKET $LIBS"
+-LDFLAGS="-L$1 -L$1/afs $LDFLAGS"
+-dnl suppress caching
+-AC_TRY_LINK([],[afsconf_Open();], ac_cv_found_afs_lib=yes, ac_cv_found_afs_lib=no)
+-LIBS="$save_LIBS"
+-LDFLAGS="$save_LDFLAGS"
+-])
+-
+-AC_DEFUN([CMU_AFS_WHERE], [
+-   for i in $1; do
+-      AC_MSG_CHECKING(for AFS in $i)
+-      CMU_AFS_INC_WHERE1("$i/include")
+-      ac_cv_found_lwp_inc=$ac_cv_found_afs_inc
+-      CMU_TEST_INCPATH($i/include, lwp) 
+-      ac_cv_found_afs_inc=$ac_cv_found_lwp_inc
+-      if test "$ac_cv_found_afs_inc" = "yes"; then
+-        CMU_AFS_LIB_WHERE1("$i/lib")
+-        if test "$ac_cv_found_afs_lib" = "yes"; then
+-          ac_cv_afs_where=$i
+-          AC_MSG_RESULT(found)
+-          break
+-        else
+-          AC_MSG_RESULT(not found)
+-        fi
+-      else
+-        AC_MSG_RESULT(not found)
+-      fi
+-    done
+-])
+-
+-AC_DEFUN([CMU_AFS], [
+-AC_REQUIRE([CMU_SOCKETS])
+-AC_REQUIRE([CMU_LIBSSL])
+-AC_ARG_WITH(AFS,
+-	[  --with-afs=PREFIX      Compile with AFS support],
+-	[if test "X$with_AFS" = "X"; then
+-		with_AFS=yes
+-	fi])
+-
+-	if test "X$with_AFS" != "X"; then
+-	  ac_cv_afs_where=$with_AFS
+-	fi
+-	if test "X$ac_cv_afs_where" = "X"; then
+-	  CMU_AFS_WHERE(/usr/afsws /usr/local /usr/athena /Library/OpenAFS/Tools)
+-	fi
+-
+-	AC_MSG_CHECKING(whether to include AFS)
+-	if test "X$ac_cv_afs_where" = "Xno" -o "X$ac_cv_afs_where" = "X"; then
+-	  ac_cv_found_afs=no
+-	  AC_MSG_RESULT(no)
+-	else
+-	  ac_cv_found_afs=yes
+-	  AC_MSG_RESULT(yes)
+-	  AFS_INC_DIR="$ac_cv_afs_where/include"
+-	  AFS_LIB_DIR="$ac_cv_afs_where/lib"
+-	  AFS_TOP_DIR="$ac_cv_afs_where"
+-	  AFS_INC_FLAGS="-I${AFS_INC_DIR}"
+-          AFS_LIB_FLAGS="-L${AFS_LIB_DIR} -L${AFS_LIB_DIR}/afs"
+-          cmu_save_LIBS="$LIBS"
+-          cmu_save_CPPFLAGS="$CPPFLAGS"
+-          CPPFLAGS="$CPPFLAGS ${AFS_INC_FLAGS}"
+-	  cmu_save_LDFLAGS="$LDFLAGS"
+- 	  LDFLAGS="$cmu_save_LDFLAGS ${AFS_LIB_FLAGS}"
+-                        
+-          AC_CHECK_HEADERS(afs/stds.h)
+-
+-          AC_MSG_CHECKING([if libdes is needed])
+-          AC_TRY_LINK([],[des_quad_cksum();],AFS_DES_LIB="",AFS_DES_LIB="maybe")
+-          if test "X$AFS_DES_LIB" != "X"; then
+-              LIBS="$cmu_save_LIBS -ldes"
+-              AC_TRY_LINK([], [des_quad_cksum();],AFS_DES_LIB="yes")
+-              if test "X$AFS_DES_LIB" = "Xyes"; then
+-                  AC_MSG_RESULT([yes])
+-    	          AFS_LIBDES="-ldes"
+-    	          AFS_LIBDESA="${AFS_LIB_DIR}/libdes.a"
+-    	      else
+-   	          LIBS="$cmu_save_LIBS $LIBSSL_LIB_FLAGS"
+- 	          AC_TRY_LINK([],
+-	          [des_quad_cksum();],AFS_DES_LIB="libcrypto")
+-	          if test "X$AFS_DES_LIB" = "Xlibcrypto"; then
+-	              AC_MSG_RESULT([libcrypto])
+-		      AFS_LIBDES="$LIBSSL_LIB_FLAGS"
+-	              AFS_LIBDESA="$LIBSSL_LIB_FLAGS"
+-	          else
+-         	      AC_MSG_RESULT([unknown])
+-	              AC_MSG_ERROR([Could not use -ldes])
+-	          fi 
+-	      fi 
+-	  else
+-             AC_MSG_RESULT([no])
+-          fi
+-
+-
+-	  AFS_CLIENT_LIBS_STATIC="${AFS_LIB_DIR}/afs/libvolser.a ${AFS_LIB_DIR}/afs/libvldb.a ${AFS_LIB_DIR}/afs/libkauth.a ${AFS_LIB_DIR}/afs/libprot.a ${AFS_LIB_DIR}/libubik.a ${AFS_LIB_DIR}/afs/libauth.a ${AFS_LIB_DIR}/librxkad.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/afs/libsys.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/liblwp.a ${AFS_LIBDESA} ${AFS_LIB_DIR}/afs/libcmd.a ${AFS_LIB_DIR}/afs/libcom_err.a ${AFS_LIB_DIR}/afs/util.a"
+-          AFS_KTC_LIBS_STATIC="${AFS_LIB_DIR}/afs/libauth.a ${AFS_LIB_DIR}/afs/libsys.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/liblwp.a ${AFS_LIBDESA} ${AFS_LIB_DIR}/afs/libcom_err.a ${AFS_LIB_DIR}/afs/util.a"
+-	  AFS_CLIENT_LIBS="-lvolser -lvldb -lkauth -lprot -lubik -lauth -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a"
+-	  AFS_RX_LIBS="-lauth -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a"
+-          AFS_KTC_LIBS="-lauth ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcom_err ${AFS_LIB_DIR}/afs/util.a"
+-
+-          LIBS="$cmu_save_LIBS $AFS_CLIENT_LIBS ${LIB_SOCKET}"
+-          AC_CHECK_FUNC(des_pcbc_init)
+-          if test "X$ac_cv_func_des_pcbc_init" != "Xyes"; then
+-           AC_CHECK_LIB(descompat, des_pcbc_init, AFS_DESCOMPAT_LIB="-ldescompat")
+-           if test "X$AFS_DESCOMPAT_LIB" != "X" ; then
+-                AFS_CLIENT_LIBS_STATIC="$AFS_CLIENT_LIBS_STATIC $AFS_DESCOMPAT_LIB"
+-                AFS_KTC_LIBS_STATIC="$AFS_KTC_LIBS_STATIC $AFS_DESCOMPAT_LIB"
+-                AFS_CLIENT_LIBS="$AFS_CLIENT_LIBS $AFS_DESCOMPAT_LIB"
+-                AFS_KTC_LIBS="$AFS_KTC_LIBS $AFS_DESCOMPAT_LIB"
+-           else
+-
+-           AC_MSG_CHECKING([if rxkad needs des_pcbc_init])
+-           AC_TRY_LINK(,[tkt_DecodeTicket();],RXKAD_PROBLEM=no,RXKAD_PROBLEM=maybe)
+-            if test "$RXKAD_PROBLEM" = "maybe"; then
+-              AC_TRY_LINK([int des_pcbc_init() { return 0;}],
+-              [tkt_DecodeTicket();],RXKAD_PROBLEM=yes,RXKAD_PROBLEM=error)
+-              if test "$RXKAD_PROBLEM" = "yes"; then
+-                    AC_MSG_RESULT([yes])
+-                    AC_MSG_ERROR([cannot use rxkad])
+-              else
+-                    AC_MSG_RESULT([unknown])        
+-                    AC_MSG_ERROR([Unknown error testing rxkad])
+-              fi
+-            else
+-              AC_MSG_RESULT([no])
+-            fi
+-           fi
+-          fi
+-
+-          LIBS="$cmu_save_LIBS"
+-          AC_CHECK_FUNC(flock)
+-          LIBS="$cmu_save_LIBS ${AFS_CLIENT_LIBS} ${LIB_SOCKET}"
+-          if test "X$ac_cv_func_flock" != "Xyes"; then
+-             AC_MSG_CHECKING([if AFS needs flock])
+-             AC_TRY_LINK([#include <afs/param.h>
+-#ifdef HAVE_AFS_STDS_H
+-#include <afs/stds.h>
+-#endif
+-#include <ubik.h>
+-#include <afs/cellconfig.h>
+-#include <afs/auth.h>
+-#include <afs/volser.h>
+-struct ubik_client * cstruct;
+-int sigvec() {return 0;}
+-extern int UV_SetSecurity();],
+-             [vsu_ClientInit(1,"","",0,
+-                             &cstruct,UV_SetSecurity)],
+-             AFS_FLOCK=no,AFS_FLOCK=yes)
+-             if test $AFS_FLOCK = "no"; then
+-                AC_MSG_RESULT([no])
+-             else
+-               AC_MSG_RESULT([yes])
+-               LDFLAGS="$LDFLAGS -L/usr/ucblib"
+-               AC_CHECK_LIB(ucb, flock,:, [AC_CHECK_LIB(BSD, flock)])
+-             fi
+-          fi
+-          LIBS="$cmu_save_LIBS"
+-          AC_CHECK_FUNC(sigvec)
+-          LIBS="$cmu_save_LIBS ${AFS_CLIENT_LIBS} ${LIB_SOCKET}"
+-          if test "X$ac_cv_func_sigvec" != "Xyes"; then
+-             AC_MSG_CHECKING([if AFS needs sigvec])
+-             AC_TRY_LINK([#include <afs/param.h>
+-#ifdef HAVE_AFS_STDS_H
+-#include <afs/stds.h>
+-#endif
+-#include <ubik.h>
+-#include <afs/cellconfig.h>
+-#include <afs/auth.h>
+-#include <afs/volser.h>
+-struct ubik_client * cstruct;
+-int flock() {return 0;}
+-extern int UV_SetSecurity();],
+-             [vsu_ClientInit(1,"","",0,
+-                             &cstruct,UV_SetSecurity)],
+-             AFS_SIGVEC=no,AFS_SIGVEC=yes)
+-             if test $AFS_SIGVEC = "no"; then
+-                AC_MSG_RESULT([no])
+-             else
+-               AC_MSG_RESULT([yes])
+-               LDFLAGS="$LDFLAGS -L/usr/ucblib"
+-               AC_CHECK_LIB(ucb, sigvec,:,[AC_CHECK_LIB(BSD, sigvec)])
+-             fi
+-          fi
+-          if test "$ac_cv_lib_ucb_flock" = "yes" -o "$ac_cv_lib_ucb_sigvec" = "yes"; then
+-             AFS_LIB_FLAGS="${AFS_LIB_FLAGS} -L/usr/ucblib -R/usr/ucblib"
+-          fi
+-          if test "$ac_cv_lib_ucb_flock" = "yes" -o "$ac_cv_lib_ucb_sigvec" = "yes"; then
+-             AFS_BSD_LIB="-lucb"
+-          elif test "$ac_cv_lib_BSD_flock" = "yes" -o "$ac_cv_lib_BSD_sigvec" = "yes"; then
+-             AFS_BSD_LIB="-lBSD"
+-          fi
+-          if test "X$AFS_BSD_LIB" != "X" ; then
+-                AFS_CLIENT_LIBS_STATIC="$AFS_CLIENT_LIBS_STATIC $AFS_BSD_LIB"
+-                AFS_KTC_LIBS_STATIC="$AFS_KTC_LIBS_STATIC $AFS_BSD_LIB"
+-                AFS_CLIENT_LIBS="$AFS_CLIENT_LIBS $AFS_BSD_LIB"
+-                AFS_RX_LIBS="$AFS_CLIENT_LIBS $AFS_BSD_LIB"
+-                AFS_KTC_LIBS="$AFS_KTC_LIBS $AFS_BSD_LIB"
+-          fi
+-
+-          AC_MSG_CHECKING([if libaudit is needed])
+-	  AFS_LIBAUDIT=""
+-          LIBS="$cmu_save_LIBS $AFS_CLIENT_LIBS ${LIB_SOCKET}"
+-          AC_TRY_LINK([#include <afs/param.h>
+-#ifdef HAVE_AFS_STDS_H
+-#include <afs/stds.h>
+-#endif
+-#include <afs/cellconfig.h>
+-#include <afs/auth.h>],
+-          [afsconf_SuperUser();],AFS_AUDIT_LIB="",AFS_AUDIT_LIB="maybe")
+-          if test "X$AFS_AUDIT_LIB" != "X"; then
+-          LIBS="$cmu_save_LIBS -lvolser -lvldb -lkauth -lprot -lubik -lauth -laudit -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a $AFS_BSD_LIB $AFS_DESCOMPAT_LIB $LIB_SOCKET"
+-             AC_TRY_LINK([#include <afs/param.h>
+-#ifdef HAVE_AFS_STDS_H
+-#include <afs/stds.h>
+-#endif
+-#include <afs/cellconfig.h>
+-#include <afs/auth.h>],
+-             [afsconf_SuperUser();],AFS_AUDIT_LIB="yes")
+-             if test "X$AFS_AUDIT_LIB" = "Xyes"; then
+-                 AC_MSG_RESULT([yes])
+-	         AFS_LIBAUDIT="-laudit"
+-	         AFS_CLIENT_LIBS_STATIC="${AFS_LIB_DIR}/afs/libvolser.a ${AFS_LIB_DIR}/afs/libvldb.a ${AFS_LIB_DIR}/afs/libkauth.a ${AFS_LIB_DIR}/afs/libprot.a ${AFS_LIB_DIR}/libubik.a ${AFS_LIB_DIR}/afs/libauth.a ${AFS_LIB_DIR}/afs/libaudit.a ${AFS_LIB_DIR}/librxkad.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/afs/libsys.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/liblwp.a ${AFS_LIBDESA} ${AFS_LIB_DIR}/afs/libcmd.a ${AFS_LIB_DIR}/afs/libcom_err.a ${AFS_LIB_DIR}/afs/util.a"
+-                 AFS_CLIENT_LIBS="-lvolser -lvldb -lkauth -lprot -lubik -lauth -laudit -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a $AFS_BSD_LIB $AFS_DESCOMPAT_LIB"
+-                 AFS_RX_LIBS="-lauth -laudit -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a $AFS_BSD_LIB $AFS_DESCOMPAT_LIB"
+-             else
+-                 AC_MSG_RESULT([unknown])
+-                 AC_MSG_ERROR([Could not use -lauth while testing for -laudit])
+-             fi 
+-          else
+-             AC_MSG_RESULT([no])
+-          fi
+-
+-	  AC_CHECK_FUNCS(VL_ProbeServer)
+-          AC_MSG_CHECKING([if new-style afs_ integer types are defined])
+-          AC_CACHE_VAL(ac_cv_afs_int32,
+-dnl The next few lines contain a quoted argument to egrep
+-dnl It is critical that there be no leading or trailing whitespace
+-dnl or newlines
+-[AC_EGREP_CPP(dnl
+-changequote(<<,>>)dnl
+-<<(^|[^a-zA-Z_0-9])afs_int32[^a-zA-Z_0-9]>>dnl
+-changequote([,]), [#include <afs/param.h>
+-#ifdef HAVE_AFS_STDS_H
+-#include <afs/stds.h>
+-#endif],
+-ac_cv_afs_int32=yes, ac_cv_afs_int32=no)])
+-          AC_MSG_RESULT($ac_cv_afs_int32)
+-          if test $ac_cv_afs_int32 = yes ; then
+-            AC_DEFINE(HAVE_AFS_INT32,, [AFS provides new "unambiguous" type names])
+-          else
+-            AC_DEFINE(afs_int16, int16, [it's a type definition])
+-            AC_DEFINE(afs_int32, int32, [it's a type definition])
+-            AC_DEFINE(afs_uint16, u_int16, [it's a type definition])
+-            AC_DEFINE(afs_uint32, u_int32, [it's a type definition])
+-          fi
+-
+-          CPPFLAGS="${cmu_save_CPPFLAGS}"
+-          LDFLAGS="${cmu_save_LDFLAGS}"
+-          LIBS="${cmu_save_LIBS}"
+-	  AC_DEFINE(AFS_ENV,, [Use AFS. (find what needs this and nuke it)])
+-          AC_DEFINE(AFS,, [Use AFS. (find what needs this and nuke it)])
+-          AC_SUBST(AFS_CLIENT_LIBS_STATIC)
+-          AC_SUBST(AFS_KTC_LIBS_STATIC)
+-          AC_SUBST(AFS_CLIENT_LIBS)
+-          AC_SUBST(AFS_RX_LIBS)
+-          AC_SUBST(AFS_KTC_LIBS)
+-          AC_SUBST(AFS_INC_FLAGS)
+-          AC_SUBST(AFS_LIB_FLAGS)
+-	  AC_SUBST(AFS_TOP_DIR)
+-	  AC_SUBST(AFS_LIBAUDIT)
+-	  AC_SUBST(AFS_LIBDES)
+-          AC_SUBST(AFS_LIBDESA)
+-       	fi
+-	])
+-
+-AC_DEFUN([CMU_NEEDS_AFS],
+-[AC_REQUIRE([CMU_AFS])
+-if test "$ac_cv_found_afs" != "yes"; then
+-        AC_ERROR([Cannot continue without AFS])
+-fi])
+-
+-dnl libssl.m4--Ssl libraries and includes
+-dnl Derrick Brashear
+-dnl from KTH kafs and Arla
+-dnl $Id: libssl.m4,v 1.9 2003/10/08 20:35:25 rjs3 Exp $
+-
+-AC_DEFUN([CMU_LIBSSL_INC_WHERE1], [
+-saved_CPPFLAGS=$CPPFLAGS
+-CPPFLAGS="$saved_CPPFLAGS -I$1"
+-CMU_CHECK_HEADER_NOCACHE(openssl/ssl.h,
+-ac_cv_found_libssl_inc=yes,
+-ac_cv_found_libssl_inc=no)
+-CPPFLAGS=$saved_CPPFLAGS
+-])
+-
+-AC_DEFUN([CMU_LIBSSL_INC_WHERE], [
+-   for i in $1; do
+-      AC_MSG_CHECKING(for libssl headers in $i)
+-      CMU_LIBSSL_INC_WHERE1($i)
+-      CMU_TEST_INCPATH($i, ssl)
+-      if test "$ac_cv_found_libssl_inc" = "yes"; then
+-        ac_cv_libssl_where_inc=$i
+-        AC_MSG_RESULT(found)
+-        break
+-      else
+-        AC_MSG_RESULT(not found)
+-      fi
+-    done
+-])
+-
+-AC_DEFUN([CMU_LIBSSL_LIB_WHERE1], [
+-saved_LIBS=$LIBS
+-LIBS="$saved_LIBS -L$1 -lssl -lcrypto $LIB_SOCKET"
+-AC_TRY_LINK(,
+-[SSL_write();],
+-[ac_cv_found_ssl_lib=yes],
+-ac_cv_found_ssl_lib=no)
+-LIBS=$saved_LIBS
+-])
+-
+-AC_DEFUN([CMU_LIBSSL_LIB_WHERE], [
+-   for i in $1; do
+-      AC_MSG_CHECKING(for libssl libraries in $i)
+-      CMU_LIBSSL_LIB_WHERE1($i)
+-      dnl deal with false positives from implicit link paths
+-      CMU_TEST_LIBPATH($i, ssl)
+-      if test "$ac_cv_found_ssl_lib" = "yes" ; then
+-        ac_cv_libssl_where_lib=$i
+-        AC_MSG_RESULT(found)
+-        break
+-      else
+-        AC_MSG_RESULT(not found)
+-      fi
+-    done
+-])
+-
+-AC_DEFUN([CMU_LIBSSL], [
+-AC_REQUIRE([CMU_SOCKETS])
+-AC_ARG_WITH(libssl,
+-	[  --with-libssl=PREFIX      Compile with Libssl support],
+-	[if test "X$with_libssl" = "X"; then
+-		with_libssl=yes
+-	fi])
+-AC_ARG_WITH(libssl-lib,
+-	[  --with-libssl-lib=dir     use libssl libraries in dir],
+-	[if test "$withval" = "yes" -o "$withval" = "no"; then
+-		AC_MSG_ERROR([No argument for --with-libssl-lib])
+-	fi])
+-AC_ARG_WITH(libssl-include,
+-	[  --with-libssl-include=dir use libssl headers in dir],
+-	[if test "$withval" = "yes" -o "$withval" = "no"; then
+-		AC_MSG_ERROR([No argument for --with-libssl-include])
+-	fi])
+-
+-	if test "X$with_libssl" != "X"; then
+-	  if test "$with_libssl" != "yes" -a "$with_libssl" != no; then
+-	    ac_cv_libssl_where_lib=$with_libssl/lib
+-	    ac_cv_libssl_where_inc=$with_libssl/include
+-	  fi
+-	fi
+-
+-	if test "$with_libssl" != "no"; then 
+-	  if test "X$with_libssl_lib" != "X"; then
+-	    ac_cv_libssl_where_lib=$with_libssl_lib
+-	  fi
+-	  if test "X$ac_cv_libssl_where_lib" = "X"; then
+-	    CMU_LIBSSL_LIB_WHERE(/usr/local/lib/openssl /usr/lib/openssl /usr/local/lib /usr/lib)
+-	  fi
+-
+-	  if test "X$with_libssl_include" != "X"; then
+-	    ac_cv_libssl_where_inc=$with_libssl_include
+-	  fi
+-	  if test "X$ac_cv_libssl_where_inc" = "X"; then
+-	    CMU_LIBSSL_INC_WHERE(/usr/local/include /usr/include)
+-	  fi
+-	fi
+-
+-	AC_MSG_CHECKING(whether to include libssl)
+-	if test "X$ac_cv_libssl_where_lib" = "X" -a "X$ac_cv_libssl_where_inc" = "X"; then
+-	  ac_cv_found_libssl=no
+-	  AC_MSG_RESULT(no)
+-	else
+-	  ac_cv_found_libssl=yes
+-	  AC_MSG_RESULT(yes)
+-	  LIBSSL_INC_DIR=$ac_cv_libssl_where_inc
+-	  LIBSSL_LIB_DIR=$ac_cv_libssl_where_lib
+-	  LIBSSL_INC_FLAGS="-I${LIBSSL_INC_DIR}"
+-	  LIBSSL_LIB_FLAGS="-L${LIBSSL_LIB_DIR} -lssl -lcrypto"
+-	  if test "X$RPATH" = "X"; then
+-		RPATH=""
+-	  fi
+-	  case "${host}" in
+-	    *-*-linux*)
+-	      if test "X$RPATH" = "X"; then
+-	        RPATH="-Wl,-rpath,${LIBSSL_LIB_DIR}"
+-	      else 
+- 		RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
+-	      fi
+-	      ;;
+-	    *-*-hpux*)
+-	      if test "X$RPATH" = "X"; then
+-	        RPATH="-Wl,+b${LIBSSL_LIB_DIR}"
+-	      else 
+-		RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
+-	      fi
+-	      ;;
+-	    *-*-irix*)
+-	      if test "X$RPATH" = "X"; then
+-	        RPATH="-Wl,-rpath,${LIBSSL_LIB_DIR}"
+-	      else 
+-		RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
+-	      fi
+-	      ;;
+-	    *-*-solaris2*)
+-	      if test "$ac_cv_prog_gcc" = yes; then
+-		if test "X$RPATH" = "X"; then
+-		  RPATH="-Wl,-R${LIBSSL_LIB_DIR}"
+-		else 
+-		  RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
+-		fi
+-	      else
+-	        RPATH="${RPATH} -R${LIBSSL_LIB_DIR}"
+-	      fi
+-	      ;;
+-	  esac
+-	  AC_SUBST(RPATH)
+-	fi
+-	AC_SUBST(LIBSSL_INC_DIR)
+-	AC_SUBST(LIBSSL_LIB_DIR)
+-	AC_SUBST(LIBSSL_INC_FLAGS)
+-	AC_SUBST(LIBSSL_LIB_FLAGS)
+-	])
+-
+-
+-dnl kerberos_v4.m4--Kerberos 4 libraries and includes
+-dnl Derrick Brashear
+-dnl from KTH krb and Arla
+-dnl $Id: kerberos_v4.m4,v 1.27 2004/02/05 18:28:47 cg2v Exp $
+-
+-AC_DEFUN([CMU_KRB_SENDAUTH_PROTO], [
+-AC_MSG_CHECKING(for krb_sendauth prototype)
+-AC_TRY_COMPILE(
+-[#include <krb.h>
+-int krb_sendauth (long options, int fd, KTEXT ktext, char *service,
+-                  char *inst, char *realm, u_long checksum,
+-                  MSG_DAT *msg_data, CREDENTIALS *cred,
+-                  Key_schedule schedule, struct sockaddr_in *laddr,
+-                  struct sockaddr_in *faddr, char *version);],
+-[int foo = krb_sendauth(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ],
+-ac_cv_krb_sendauth_proto=no,
+-ac_cv_krb_sendauth_proto=yes)
+-AC_MSG_RESULT($ac_cv_krb_sendauth_proto)
+-if test "$ac_cv_krb_sendauth_proto" = yes; then
+-        AC_DEFINE(HAVE_KRB_SENDAUTH_PROTO)dnl
+-fi
+-AC_MSG_RESULT($ac_cv_krb_sendauth_proto)
+-])
+-
+-AC_DEFUN([CMU_KRB_SET_KEY_PROTO], [
+-AC_MSG_CHECKING(for krb_set_key prototype)
+-AC_CACHE_VAL(ac_cv_krb_set_key_proto, [
+-cmu_save_CPPFLAGS="$CPPFLAGS"
+-CPPFLAGS="${CPPFLAGS} ${KRB_INC_FLAGS}"
+-AC_TRY_COMPILE(
+-[#include <krb.h>
+-int krb_set_key(char *key, int cvt);],
+-[int foo = krb_set_key(0, 0);],
+-ac_cv_krb_set_key_proto=no,
+-ac_cv_krb_set_key_proto=yes)
+-])
+-CPPFLAGS="${cmu_save_CPPFLAGS}"
+-if test "$ac_cv_krb_set_key_proto" = yes; then
+-	AC_DEFINE(HAVE_KRB_SET_KEY_PROTO)dnl
+-fi
+-AC_MSG_RESULT($ac_cv_krb_set_key_proto)
+-])
+-
+-AC_DEFUN([CMU_KRB4_32_DEFN], [
+-AC_MSG_CHECKING(for KRB4_32 definition)
+-AC_CACHE_VAL(ac_cv_krb4_32_defn, [
+-cmu_save_CPPFLAGS="$CPPFLAGS"
+-CPPFLAGS="${CPPFLAGS} ${KRB_INC_FLAGS}"
+-AC_TRY_COMPILE(
+-[#include <krb.h>
+-],
+-[KRB4_32 foo = 1;],
+-ac_cv_krb4_32_defn=yes,
+-ac_cv_krb4_32_defn=no)
+-])
+-CPPFLAGS="${cmu_save_CPPFLAGS}"
+-if test "$ac_cv_krb4_32_defn" = yes; then
+-	AC_DEFINE(HAVE_KRB4_32_DEFINE)dnl
+-fi
+-AC_MSG_RESULT($ac_cv_krb4_32_defn)
+-])
+-
+-AC_DEFUN([CMU_KRB_RD_REQ_PROTO], [
+-AC_MSG_CHECKING(for krb_rd_req prototype)
+-AC_CACHE_VAL(ac_cv_krb_rd_req_proto, [
+-cmu_save_CPPFLAGS="$CPPFLAGS"
+-CPPFLAGS="${CPPFLAGS} ${KRB_INC_FLAGS}"
+-AC_TRY_COMPILE(
+-[#include <krb.h>
+-int krb_rd_req(KTEXT authent, char *service, char *instance,
+-unsigned KRB_INT32 from_addr, AUTH_DAT *ad, char *fn);],
+-[int foo = krb_rd_req(0,0,0,0,0,0);],
+-ac_cv_krb_rd_req_proto=no,
+-ac_cv_krb_rd_req_proto=yes)
+-])
+-CPPFLAGS="${cmu_save_CPPFLAGS}"
+-if test "$ac_cv_krb_rd_req_proto" = yes; then
+-	AC_DEFINE(HAVE_KRB_RD_REQ_PROTO)dnl
+-fi
+-AC_MSG_RESULT($ac_cv_krb_rd_req_proto)
+-])
+-
+-AC_DEFUN([CMU_KRB_INC_WHERE1], [
+-saved_CPPFLAGS=$CPPFLAGS
+-CPPFLAGS="$saved_CPPFLAGS -I$1"
+-AC_TRY_COMPILE([#include <krb.h>],
+-[struct ktext foo;],
+-ac_cv_found_krb_inc=yes,
+-ac_cv_found_krb_inc=no)
+-if test "$ac_cv_found_krb_inc" = "no"; then
+-  CPPFLAGS="$saved_CPPFLAGS -I$1 -I$1/kerberosIV"
+-  AC_TRY_COMPILE([#include <krb.h>],
+-  [struct ktext foo;],
+-  [ac_cv_found_krb_inc=yes],
+-  ac_cv_found_krb_inc=no)
+-fi
+-CPPFLAGS=$saved_CPPFLAGS
+-])
+-
+-AC_DEFUN([CMU_KRB_INC_WHERE], [
+-   for i in $1; do
+-      AC_MSG_CHECKING(for kerberos headers in $i)
+-      CMU_KRB_INC_WHERE1($i)
+-      CMU_TEST_INCPATH($i, krb)
+-      if test "$ac_cv_found_krb_inc" = "yes"; then
+-        ac_cv_krb_where_inc=$i
+-        AC_MSG_RESULT(found)
+-        break
+-      else
+-        AC_MSG_RESULT(not found)
+-      fi
+-    done
+-])
+-
+-#
+-# Test for kerberos lib files
+-#
+-
+-AC_DEFUN([CMU_KRB_LIB_WHERE1], [
+-saved_LIBS=$LIBS
+-LIBS="$saved_LIBS -L$1 -lkrb ${KRB_LIBDES}"
+-AC_TRY_LINK(,
+-[dest_tkt();],
+-[ac_cv_found_krb_lib=yes],
+-ac_cv_found_krb_lib=no)
+-LIBS=$saved_LIBS
+-])
+-
+-AC_DEFUN([CMU_KRB_LIB_WHERE], [
+-   for i in $1; do
+-      AC_MSG_CHECKING(for kerberos libraries in $i)
+-      CMU_KRB_LIB_WHERE1($i)
+-      dnl deal with false positives from implicit link paths
+-      CMU_TEST_LIBPATH($i, krb)
+-      if test "$ac_cv_found_krb_lib" = "yes" ; then
+-        ac_cv_krb_where_lib=$i
+-        AC_MSG_RESULT(found)
+-        break
+-      else
+-        AC_MSG_RESULT(not found)
+-      fi
+-    done
+-])
+-
+-AC_DEFUN([CMU_KRB4], [
+-AC_REQUIRE([CMU_SOCKETS])
+-AC_REQUIRE([CMU_LIBSSL])
+-AC_ARG_WITH(krb4,
+-	[  --with-krb4=PREFIX      Compile with Kerberos 4 support],
+-	[if test "X$with_krb4" = "X"; then
+-		with_krb4=yes
+-	fi])
+-AC_ARG_WITH(krb4-lib,
+-	[  --with-krb4-lib=dir     use kerberos 4 libraries in dir],
+-	[if test "$withval" = "yes" -o "$withval" = "no"; then
+-		AC_MSG_ERROR([No argument for --with-krb4-lib])
+-	fi])
+-AC_ARG_WITH(krb4-include,
+-	[  --with-krb4-include=dir use kerberos 4 headers in dir],
+-	[if test "$withval" = "yes" -o "$withval" = "no"; then
+-		AC_MSG_ERROR([No argument for --with-krb4-include])
+-	fi])
+-
+-	if test "X$with_krb4" != "X"; then
+-	  if test "$with_krb4" != "yes" -a "$with_krb4" != "no"; then
+-	    ac_cv_krb_where_lib=$with_krb4/lib
+-	    ac_cv_krb_where_inc=$with_krb4/include
+-	  fi
+-	fi
+-       
+-	if test "$with_krb4" != "no"; then
+-	  if test "X$with_krb4_lib" != "X"; then
+-	    ac_cv_krb_where_lib=$with_krb4_lib
+-	  fi
+-	  if test "X$with_krb4_include" != "X"; then
+-	    ac_cv_krb_where_inc=$with_krb4_include
+-	  fi
+-	  if test "X$ac_cv_krb_where_inc" = "X"; then
+-	    CMU_KRB_INC_WHERE(/usr/athena/include /usr/include/kerberosIV /usr/local/include /usr/include/kerberos)
+-	  fi
+-
+-          AC_MSG_CHECKING([if libdes is needed])
+-          AC_TRY_LINK([],[des_quad_cksum();],KRB_DES_LIB="",KRB_DES_LIB="maybe")
+-          if test "X$KRB_DES_LIB" != "X"; then
+-              LIBS="$cmu_save_LIBS -ldes"
+-              AC_TRY_LINK([], [des_quad_cksum();],KRB_DES_LIB="yes")
+-              if test "X$KRB_DES_LIB" = "Xyes"; then
+-                  AC_MSG_RESULT([yes])
+-                  KRB_LIBDES="-ldes"
+-                  KRB_LIBDESA='$(KRB_LIB_DIR)/libdes.a'
+-              else
+-                  LIBS="$cmu_save_LIBS $LIBSSL_LIB_FLAGS"
+-                  AC_TRY_LINK([],
+-                  [des_quad_cksum();],KRB_DES_LIB="libcrypto")
+-                  if test "X$KRB_DES_LIB" = "Xlibcrypto"; then
+-                      AC_MSG_RESULT([libcrypto])
+-                      KRB_LIBDES="$LIBSSL_LIB_FLAGS"
+-                      KRB_LIBDESA="$LIBSSL_LIB_FLAGS"
+-                  else
+-                      AC_MSG_RESULT([unknown])
+-                      AC_MSG_ERROR([Could not use -ldes])
+-                  fi 
+-              fi 
+-          else
+-             AC_MSG_RESULT([no])
+-          fi
+-          if test "X$ac_cv_krb_where_lib" = "X"; then
+-            CMU_KRB_LIB_WHERE(/usr/athena/lib /usr/local/lib /usr/lib)
+-          fi
+-	fi
+-	  LIBS="${cmu_save_LIBS}"
+-
+-
+-	AC_MSG_CHECKING([whether to include kerberos 4])
+-	if test "X$ac_cv_krb_where_lib" = "X" -o "X$ac_cv_krb_where_inc" = "X"; then
+-	  ac_cv_found_krb=no
+-	  AC_MSG_RESULT(no)
+-	else
+-	  ac_cv_found_krb=yes
+-	  AC_MSG_RESULT(yes)
+-	  KRB_INC_DIR=$ac_cv_krb_where_inc
+-	  KRB_LIB_DIR=$ac_cv_krb_where_lib
+-	  KRB_INC_FLAGS="-I${KRB_INC_DIR}"
+-	  KRB_LIB_FLAGS="-L${KRB_LIB_DIR} -lkrb ${KRB_LIBDES}"
+-	  LIBS="${cmu_save_LIBS} ${KRB_LIB_FLAGS}"
+-	  AC_CHECK_LIB(resolv, dns_lookup, KRB_LIB_FLAGS="${KRB_LIB_FLAGS} -lresolv",,"${KRB_LIB_FLAGS}")
+-	  AC_CHECK_LIB(crypt, crypt, KRB_LIB_FLAGS="${KRB_LIB_FLAGS} -lcrypt",,"${KRB_LIB_FLAGS}")
+-	  LIBS="${LIBS} ${KRB_LIB_FLAGS}"
+-	  AC_CHECK_FUNCS(krb_get_int krb_life_to_time)
+-          AC_SUBST(KRB_INC_FLAGS)
+-          AC_SUBST(KRB_LIB_FLAGS)
+-	  LIBS="${cmu_save_LIBS}"
+-	  AC_DEFINE(KERBEROS,,[Use kerberos 4. find out what needs this symbol])
+-	  if test "X$RPATH" = "X"; then
+-		RPATH=""
+-	  fi
+-	  case "${host}" in
+-	    *-*-linux*)
+-	      if test "X$RPATH" = "X"; then
+-	        RPATH="-Wl,-rpath,${KRB_LIB_DIR}"
+-	      else 
+-		RPATH="${RPATH}:${KRB_LIB_DIR}"
+-	      fi
+-	      ;;
+-	    *-*-hpux*)
+-	      if test "X$RPATH" = "X"; then
+-	        RPATH="-Wl,+b${KRB_LIB_DIR}"
+-	      else 
+-		RPATH="${RPATH}:${KRB_LIB_DIR}"
+-	      fi
+-	      ;;
+-	    *-*-irix*)
+-	      if test "X$RPATH" = "X"; then
+-	        RPATH="-Wl,-rpath,${KRB_LIB_DIR}"
+-	      else 
+-		RPATH="${RPATH}:${KRB_LIB_DIR}"
+-	      fi
+-	      ;;
+-	    *-*-solaris2*)
+-	      if test "$ac_cv_prog_gcc" = yes; then
+-		if test "X$RPATH" = "X"; then
+-		  RPATH="-Wl,-R${KRB_LIB_DIR}"
+-		else 
+-		  RPATH="${RPATH}:${KRB_LIB_DIR}"
+-		fi
+-	      else
+-	        RPATH="${RPATH} -R${KRB_LIB_DIR}"
+-	      fi
+-	      ;;
+-	  esac
+-	  AC_SUBST(RPATH)
+-	fi
+-	])
+-
+-
+-dnl sasl2.m4--sasl2 libraries and includes
+-dnl Rob Siemborski
+-dnl $Id: sasl2.m4,v 1.48 2004/09/13 21:06:34 shadow Exp $
+-
+-AC_DEFUN([SASL_GSSAPI_CHK],[
+- AC_ARG_ENABLE(gssapi, [  --enable-gssapi=<DIR>   enable GSSAPI authentication [yes] ],
+-    gssapi=$enableval,
+-    gssapi=yes)
+- AC_ARG_WITH(gss_impl, [  --with-gss_impl={heimdal|mit|cybersafe|seam|auto}                                                       choose specific GSSAPI implementation [[auto]] ],
+-    gss_impl=$withval,
+-    gss_impl=auto)
+- AC_REQUIRE([SASL2_CRYPT_CHK])
+- AC_REQUIRE([CMU_SOCKETS])
+-
+- if test "$gssapi" != no; then
+-    platform=
+-    case "${host}" in
+-      *-*-linux*)
+-        platform=__linux
+-        ;;
+-      *-*-hpux*)
+-        platform=__hpux
+-        ;;
+-      *-*-irix*)
+-        platform=__irix
+-        ;;
+-      *-*-solaris2*)
+-# When should we use __sunos?
+-        platform=__solaris
+-        ;;
+-      *-*-aix*)
+-        platform=__aix
+-        ;;
+-      *)
+-        AC_WARN([The system type is not recognized. If you believe that CyberSafe GSSAPI works on this platform, please update the configure script])
+-	if test "$gss_impl" = "cybersafe"; then
+-	   AC_ERROR([CyberSafe was forced, cannot continue as platform is not supported])
+-	fi
+-        ;;
+-    esac
+-
+-    cmu_saved_CPPFLAGS=$CPPFLAGS
+-
+-    if test -d ${gssapi}; then
+-       CPPFLAGS="$CPPFLAGS -I$gssapi/include"
+-# We want to keep -I in our CPPFLAGS, but only if we succeed
+-       cmu_saved_CPPFLAGS=$CPPFLAGS
+-       LDFLAGS="$LDFLAGS -L$gssapi/lib"
+-
+-       if test -n "$platform"; then
+-         if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then
+-           CPPFLAGS="$CPPFLAGS -D$platform"
+-           if test -d "${gssapi}/appsec-sdk/include"; then
+-             CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include"
+-           fi
+-         fi
+-       fi
+-    fi
+-    AC_CHECK_HEADER(gssapi.h, AC_DEFINE(HAVE_GSSAPI_H,,[Define if you have the gssapi.h header file]), [
+-      AC_CHECK_HEADER(gssapi/gssapi.h,, AC_WARN(Disabling GSSAPI - no include files found); gssapi=no)])
+-
+-    CPPFLAGS=$cmu_saved_CPPFLAGS
+-
+- fi
+-
+- if test "$gssapi" != no; then
+-  dnl We need to find out which gssapi implementation we are
+-  dnl using. Supported alternatives are: MIT Kerberos 5,
+-  dnl Heimdal Kerberos 5 (http://www.pdc.kth.se/heimdal),
+-  dnl CyberSafe Kerberos 5 (http://www.cybersafe.com/)
+-  dnl and Sun SEAM (http://wwws.sun.com/software/security/kerberos/)
+-  dnl
+-  dnl The choice is reflected in GSSAPIBASE_LIBS
+-
+-  AC_CHECK_LIB(resolv,res_search)
+-  if test -d ${gssapi}; then
+-     gssapi_dir="${gssapi}/lib"
+-     GSSAPIBASE_LIBS="-L$gssapi_dir"
+-     GSSAPIBASE_STATIC_LIBS="-L$gssapi_dir"
+-  else
+-     dnl FIXME: This is only used for building cyrus, and then only as
+-     dnl a real hack.  it needs to be fixed.
+-     gssapi_dir="/usr/local/lib"
+-  fi
+-
+-  # Check a full link against the Heimdal libraries.
+-  # If this fails, check a full link against the MIT libraries.
+-  # If this fails, check a full link against the CyberSafe libraries.
+-  # If this fails, check a full link against the Solaris 8 and up libgss.
+-
+-  if test "$gss_impl" = "auto" -o "$gss_impl" = "heimdal"; then
+-    gss_failed=0
+-    AC_CHECK_LIB(gssapi,gss_unwrap,gss_impl="heimdal",gss_failed=1,$GSSAPIBASE_LIBS -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err ${LIB_SOCKET})
+-    if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then
+-      gss_impl="failed"
+-    fi
+-  fi
+-
+-  if test "$gss_impl" = "auto" -o "$gss_impl" = "mit"; then
+-    gss_failed=0
+-    AC_CHECK_LIB(gssapi_krb5,gss_unwrap,gss_impl="mit",gss_failed=1,$GSSAPIBASE_LIBS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${LIB_SOCKET})
+-    if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then
+-      gss_impl="failed"
+-    fi
+-  fi
+-
+-  # For Cybersafe one has to set a platform define in order to make compilation work
+-  if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then
+-
+-    cmu_saved_CPPFLAGS=$CPPFLAGS
+-    cmu_saved_GSSAPIBASE_LIBS=$GSSAPIBASE_LIBS
+-# FIX ME - Note that the libraries are in .../lib/64 for 64bit kernels
+-    if test -d "${gssapi}/appsec-rt/lib"; then
+-      GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -L${gssapi}/appsec-rt/lib"
+-    fi
+-    CPPFLAGS="$CPPFLAGS -D$platform"
+-    if test -d "${gssapi}/appsec-sdk/include"; then
+-      CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include"
+-    fi
+-
+-    gss_failed=0
+-
+-# Check for CyberSafe with two libraries first, than fall back to a single 
+-# library (older CyberSafe)
+-
+-    unset ac_cv_lib_gss_csf_gss_acq_user
+-    AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe03",[
+-      unset ac_cv_lib_gss_csf_gss_acq_user;AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe",gss_failed=1,$GSSAPIBASE_LIBS -lgss)],$GSSAPIBASE_LIBS -lgss -lcstbk5)
+-
+-    if test "$gss_failed" = "1"; then
+-# Restore variables
+-      GSSAPIBASE_LIBS=$cmu_saved_GSSAPIBASE_LIBS
+-      CPPFLAGS=$cmu_saved_CPPFLAGS
+-
+-      if test "$gss_impl" != "auto"; then
+-        gss_impl="failed"
+-      fi
+-    fi
+-  fi
+-
+-  if test "$gss_impl" = "auto" -o "$gss_impl" = "seam"; then
+-    gss_failed=0
+-    AC_CHECK_LIB(gss,gss_unwrap,gss_impl="seam",gss_failed=1,-lgss)
+-    if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then
+-      gss_impl="failed"
+-    fi
+-  fi
+-
+-  if test "$gss_impl" = "mit"; then
+-    GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err"
+-    GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_LIBS $gssapi_dir/libgssapi_krb5.a $gssapi_dir/libkrb5.a $gssapi_dir/libk5crypto.a $gssapi_dir/libcom_err.a"
+-  elif test "$gss_impl" = "heimdal"; then
+-    CPPFLAGS="$CPPFLAGS -DKRB5_HEIMDAL"
+-    GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err"
+-    GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_STATIC_LIBS $gssapi_dir/libgssapi.a $gssapi_dir/libkrb5.a $gssapi_dir/libasn1.a $gssapi_dir/libroken.a $gssapi_dir/libcom_err.a ${LIB_CRYPT}"
+-  elif test "$gss_impl" = "cybersafe03"; then
+-# Version of CyberSafe with two libraries
+-    CPPFLAGS="$CPPFLAGS -D$platform -I${gssapi}/appsec-sdk/include"
+-    GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgss -lcstbk5"
+-    # there is no static libgss for CyberSafe
+-    GSSAPIBASE_STATIC_LIBS=none
+-  elif test "$gss_impl" = "cybersafe"; then
+-    CPPFLAGS="$CPPFLAGS -D$platform -I${gssapi}/appsec-sdk/include"
+-    GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgss"
+-    # there is no static libgss for CyberSafe
+-    GSSAPIBASE_STATIC_LIBS=none
+-  elif test "$gss_impl" = "seam"; then
+-    GSSAPIBASE_LIBS=-lgss
+-    # there is no static libgss on Solaris 8 and up
+-    GSSAPIBASE_STATIC_LIBS=none
+-  elif test "$gss_impl" = "failed"; then
+-    gssapi="no"
+-    GSSAPIBASE_LIBS=
+-    GSSAPIBASE_STATIC_LIBS=
+-    AC_WARN(Disabling GSSAPI - specified library not found)
+-  else
+-    gssapi="no"
+-    GSSAPIBASE_LIBS=
+-    GSSAPIBASE_STATIC_LIBS=
+-    AC_WARN(Disabling GSSAPI - no library)
+-  fi
+- fi
+-
+-#
+-# Cybersafe defines both GSS_C_NT_HOSTBASED_SERVICE and GSS_C_NT_USER_NAME in gssapi\rfckrb5.h
+-#
+- if test "$gssapi" != "no"; then
+-  if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then
+-   AC_EGREP_CPP(hostbased_service_gss_nt_yes,
+-    [#include <gssapi/gssapi.h>
+-     #ifdef GSS_C_NT_HOSTBASED_SERVICE
+-      hostbased_service_gss_nt_yes
+-     #endif
+-    ], AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,[Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE]), AC_WARN(Cybersafe define not found))
+-
+-  elif test "$ac_cv_header_gssapi_h" = "yes"; then
+-   AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h,
+-     AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,[Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE]))
+-  elif test "$ac_cv_header_gssapi_gssapi_h"; then
+-
+-   AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h,
+-     AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,[Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE]))
+-  fi
+-
+-  if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then
+-   AC_EGREP_CPP(user_name_yes_gss_nt,
+-    [#include <gssapi/gssapi.h>
+-     #ifdef GSS_C_NT_USER_NAME
+-      user_name_yes_gss_nt
+-     #endif
+-    ], AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,[Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME]), AC_WARN(Cybersafe define not found))
+-  elif test "$ac_cv_header_gssapi_h" = "yes"; then
+-   AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi.h,
+-    AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,[Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME]))
+-  elif test "$ac_cv_header_gssapi_gssapi_h"; then
+-   AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi/gssapi.h,
+-    AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,[Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME]))
+-  fi
+- fi
+-
+- GSSAPI_LIBS=""
+- AC_MSG_CHECKING(GSSAPI)
+- if test "$gssapi" != no; then
+-  AC_MSG_RESULT(with implementation ${gss_impl})
+-  AC_CHECK_LIB(resolv,res_search,GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lresolv")
+-  SASL_MECHS="$SASL_MECHS libgssapiv2.la"
+-  SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/gssapi.o"
+-
+-  cmu_save_LIBS="$LIBS"
+-  LIBS="$LIBS $GSSAPIBASE_LIBS"
+-  AC_CHECK_FUNCS(gsskrb5_register_acceptor_identity)
+-  LIBS="$cmu_save_LIBS"
+-else
+-  AC_MSG_RESULT(disabled)
+-fi
+-AC_SUBST(GSSAPI_LIBS)
+-AC_SUBST(GSSAPIBASE_LIBS)
+-])
+-
+-AC_DEFUN([SASL_SET_GSSAPI_LIBS], [
+-    SASL_GSSAPI_LIBS_SET="yes"
+-])
+-
+-dnl What we want to do here is setup LIB_SASL with what one would
+-dnl generally want to have (e.g. if static is requested, make it that,
+-dnl otherwise make it dynamic.
+-
+-dnl We also want to create LIB_DYN_SASL and DYNSASLFLAGS.
+-
+-dnl Also sets using_static_sasl to "no" "static" or "staticonly"
+-
+-AC_DEFUN([CMU_SASL2], [
+-	AC_REQUIRE([SASL_GSSAPI_CHK])
+-
+-AC_ARG_WITH(sasl,
+-            [  --with-sasl=DIR         Compile with libsasl2 in <DIR>],
+-	    with_sasl="$withval",
+-            with_sasl="yes")
+-
+-AC_ARG_WITH(staticsasl,
+-	    [  --with-staticsasl=DIR   Compile with staticly linked libsasl2 in <DIR>],
+-	    with_staticsasl="$withval";
+-	    if test $with_staticsasl != "no"; then
+-		using_static_sasl="static"
+-	    fi,
+-	    with_staticsasl="no"; using_static_sasl="no")
+-
+-	SASLFLAGS=""
+-	LIB_SASL=""
+-
+-	cmu_saved_CPPFLAGS=$CPPFLAGS
+-	cmu_saved_LDFLAGS=$LDFLAGS
+-	cmu_saved_LIBS=$LIBS
+-
+-	if test ${with_staticsasl} != "no"; then
+-	  if test -d ${with_staticsasl}; then
+-	    if test -d ${with_staticsasl}/lib64 ; then
+-	      ac_cv_sasl_where_lib=${with_staticsasl}/lib64
+-	    else
+-	      ac_cv_sasl_where_lib=${with_staticsasl}/lib
+-	    fi
+-	    ac_cv_sasl_where_lib=${with_staticsasl}/lib
+-	    ac_cv_sasl_where_inc=${with_staticsasl}/include
+-
+-	    SASLFLAGS="-I$ac_cv_sasl_where_inc"
+-	    LIB_SASL="-L$ac_cv_sasl_where_lib"
+-	    CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
+-	    LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
+-	  else
+-	    with_staticsasl="/usr"
+-	  fi
+-
+-	  AC_CHECK_HEADER(sasl/sasl.h, [
+-	    AC_CHECK_HEADER(sasl/saslutil.h, [
+-	     for i42 in lib64 lib; do
+-	        if test -r ${with_staticsasl}/$i42/libsasl2.a; then
+-		  ac_cv_found_sasl=yes
+-		  AC_MSG_CHECKING(for static libsasl)
+-		  LIB_SASL="$LIB_SASL ${with_staticsasl}/$i42/libsasl2.a"
+-		fi
+-	     done
+-             if test ! "$ac_cv_found_sasl" = "yes"; then
+-	          AC_MSG_CHECKING(for static libsasl)
+-		  AC_ERROR([Could not find ${with_staticsasl}/lib*/libsasl2.a])
+-             fi
+-	    ])])
+-
+-	  AC_MSG_RESULT(found)
+-
+-          if test "x$SASL_GSSAPI_LIBS_SET" = "x"; then
+-	    LIB_SASL="$LIB_SASL $GSSAPIBASE_STATIC_LIBS"
+-	  else
+-	    SASL_GSSAPI_LIBS_SET=""
+-	    cmu_saved_LIBS="$GSSAPIBASE_STATIC_LIBS $cmu_saved_LIBS" 
+-	  fi
+-	fi
+-
+-	if test -d ${with_sasl}; then
+-            ac_cv_sasl_where_lib=${with_sasl}/lib
+-            ac_cv_sasl_where_inc=${with_sasl}/include
+-
+-	    DYNSASLFLAGS="-I$ac_cv_sasl_where_inc"
+-	    if test "$ac_cv_sasl_where_lib" != ""; then
+-		CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, LIB_DYN_SASL)
+-	    fi
+-	    LIB_DYN_SASL="$LIB_DYN_SASL -lsasl2"
+-	    CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
+-	    LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
+-	fi
+-
+-	dnl be sure to check for a SASLv2 specific function
+-	AC_CHECK_HEADER(sasl/sasl.h, [
+-	    AC_CHECK_HEADER(sasl/saslutil.h, [
+-	      AC_CHECK_LIB(sasl2, prop_get, 
+-                           ac_cv_found_sasl=yes,
+-		           ac_cv_found_sasl=no)],
+-	                   ac_cv_found_sasl=no)], ac_cv_found_sasl=no)
+-
+-	if test "$ac_cv_found_sasl" = "yes"; then
+-	    if test "$ac_cv_sasl_where_lib" != ""; then
+-	        CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, DYNLIB_SASL)
+-	    fi
+-	    DYNLIB_SASL="$DYNLIB_SASL -lsasl2"
+-	    if test "$using_static_sasl" != "static"; then
+-		LIB_SASL=$DYNLIB_SASL
+-		SASLFLAGS=$DYNSASLFLAGS
+-	    fi
+-	else
+-	    DYNLIB_SASL=""
+-	    DYNSASLFLAGS=""
+-	    using_static_sasl="staticonly"
+-	fi
+-
+-        if test "x$SASL_GSSAPI_LIBS_SET" != "x"; then
+-	    SASL_GSSAPI_LIBS_SET=""
+-	    cmu_saved_LIBS="$GSSAPIBASE_LIBS $cmu_saved_LIBS" 
+-	fi
+-
+-	LIBS="$cmu_saved_LIBS"
+-	LDFLAGS="$cmu_saved_LDFLAGS"
+-	CPPFLAGS="$cmu_saved_CPPFLAGS"
+-
+-	AC_SUBST(LIB_DYN_SASL)
+-	AC_SUBST(DYNSASLFLAGS)
+-	AC_SUBST(LIB_SASL)
+-	AC_SUBST(SASLFLAGS)
+-	])
+-
+-AC_DEFUN([CMU_SASL2_REQUIRED],
+-[AC_REQUIRE([CMU_SASL2])
+-if test "$ac_cv_found_sasl" != "yes"; then
+-        AC_ERROR([Cannot continue without libsasl2.
+-Get it from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/.])
+-fi])
+-
+-AC_DEFUN([CMU_SASL2_REQUIRE_VER], [
+-	AC_REQUIRE([CMU_SASL2_REQUIRED])
+-
+-	cmu_saved_CPPFLAGS=$CPPFLAGS
+-	CPPFLAGS="$CPPFLAGS $SASLFLAGS"
+-
+-	AC_TRY_CPP([
+-#include <sasl/sasl.h>
+-
+-#ifndef SASL_VERSION_MAJOR
+-#error SASL_VERSION_MAJOR not defined
+-#endif
+-#ifndef SASL_VERSION_MINOR
+-#error SASL_VERSION_MINOR not defined
+-#endif
+-#ifndef SASL_VERSION_STEP
+-#error SASL_VERSION_STEP not defined
+-#endif
+-
+-#if SASL_VERSION_MAJOR < $1 || SASL_VERSION_MINOR < $2 || SASL_VERSION_STEP < $3
+-#error SASL version is less than $1.$2.$3
+-#endif
+-	],,AC_ERROR([Incorrect SASL headers found.  This package requires SASL $1.$2.$3 or newer.]))
+-
+-	CPPFLAGS=$cmu_saved_CPPFLAGS
+-])
+-
+-AC_DEFUN([CMU_SASL2_CHECKAPOP_REQUIRED], [
+-	AC_REQUIRE([CMU_SASL2_REQUIRED])
+-
+-	cmu_saved_LDFLAGS=$LDFLAGS
+-
+-	LDFLAGS="$LDFLAGS $LIB_SASL"
+-
+-	AC_CHECK_LIB(sasl2, sasl_checkapop, AC_DEFINE(HAVE_APOP,[],[Does SASL support APOP?]),
+-		AC_MSG_ERROR([libsasl2 without working sasl_checkapop.  Cannot continue.]))
+-
+-	LDFLAGS=$cmu_saved_LDFLAGS
+-])
+-
+-AC_DEFUN([SASL2_CRYPT_CHK],[
+- AC_CHECK_FUNC(crypt, cmu_have_crypt=yes, [
+-  AC_CHECK_LIB(crypt, crypt,
+-	       LIB_CRYPT="-lcrypt"; cmu_have_crypt=yes,
+-	       cmu_have_crypt=no)])
+- AC_SUBST(LIB_CRYPT)
+-])
+-
+-dnl libwrap.m4 --- do we have libwrap, the access control library?
+-dnl $Id: libwrap.m4,v 1.9 2003/10/22 18:50:02 rjs3 Exp $
+-
+-AC_DEFUN([CMU_LIBWRAP], [
+-  AC_REQUIRE([CMU_SOCKETS])
+-  AC_ARG_WITH(libwrap, 
+-              [  --with-libwrap=DIR      use libwrap (rooted in DIR) [yes] ],
+-              with_libwrap=$withval, with_libwrap=yes)
+-  if test "$with_libwrap" != no; then
+-    if test -d "$with_libwrap"; then
+-      CPPFLAGS="$CPPFLAGS -I${with_libwrap}/include"
+-      LDFLAGS="$LDFLAGS -L${with_libwrap}/lib"
+-    fi
+-    cmu_save_LIBS="$LIBS"
+-    AC_CHECK_LIB(wrap, request_init, [
+-		 AC_CHECK_HEADER(tcpd.h,, with_libwrap=no)],
+-		 with_libwrap=no, ${LIB_SOCKET})
+-    LIBS="$cmu_save_LIBS"
+-  fi
+-  AC_MSG_CHECKING(libwrap support)
+-  AC_MSG_RESULT($with_libwrap)
+-  LIB_WRAP=""
+-  if test "$with_libwrap" != no; then
+-    AC_DEFINE(HAVE_LIBWRAP,[],[Do we have TCP wrappers?])
+-    LIB_WRAP="-lwrap"
+-    AC_CHECK_LIB(nsl, yp_get_default_domain, LIB_WRAP="${LIB_WRAP} -lnsl")
+-  fi
+-  AC_SUBST(LIB_WRAP)
+-])
+-
+-dnl look for the (ucd|net)snmp libraries
+-dnl $Id: ucdsnmp.m4,v 1.10 2004/05/24 19:25:41 ken3 Exp $
+-
+-AC_DEFUN([CMU_UCDSNMP], [
+-  AC_REQUIRE([CMU_SOCKETS])
+-  AC_ARG_WITH(snmp, 
+-              [  --with-snmp=DIR         use ucd|net snmp (rooted in DIR) [yes] ],
+-              with_snmp=$withval, with_snmp=yes)
+-
+-  dnl
+-  dnl Maintain backwards compatibility with old --with-ucdsnmp option
+-  dnl
+-  AC_ARG_WITH(ucdsnmp,, with_snmp=$withval,)
+-
+-if test "$with_snmp" != "no"; then
+-
+-  dnl
+-  dnl Try net-snmp first
+-  dnl
+-  if test "$with_snmp" = "yes"; then
+-    AC_PATH_PROG(SNMP_CONFIG,net-snmp-config,,[/usr/local/bin:$PATH])
+-  else
+-    SNMP_CONFIG="$with_snmp/bin/net-snmp-config"
+-  fi
+-
+-  if test -x "$SNMP_CONFIG"; then
+-    AC_MSG_CHECKING(NET SNMP libraries)
+-
+-    SNMP_LIBS=`$SNMP_CONFIG --agent-libs`
+-    SNMP_PREFIX=`$SNMP_CONFIG --prefix`
+-
+-    if test -n "$SNMP_LIBS" && test -n "$SNMP_PREFIX"; then
+-      CPPFLAGS="$CPPFLAGS -I${SNMP_PREFIX}/include"
+-      LIB_UCDSNMP=$SNMP_LIBS
+-      AC_DEFINE(HAVE_NETSNMP,1,[Do we have Net-SNMP support?])
+-      AC_SUBST(LIB_UCDSNMP)
+-      AC_MSG_RESULT(yes)
+-    else
+-      AC_MSG_RESULT(no)
+-      AC_MSG_WARN([Could not find the required paths. Please check your net-snmp installation.])
+-    fi
+-  else
+-    dnl
+-    dnl Try ucd-snmp if net-snmp test failed
+-    dnl
+-    if test "$with_snmp" != no; then
+-      if test -d "$with_snmp"; then
+-        CPPFLAGS="$CPPFLAGS -I${with_snmp}/include"
+-        LDFLAGS="$LDFLAGS -L${with_snmp}/lib"
+-      fi
+-      cmu_save_LIBS="$LIBS"
+-      AC_CHECK_LIB(snmp, sprint_objid, [
+-  		 AC_CHECK_HEADER(ucd-snmp/version.h,, with_snmp=no)],
+-  		 with_snmp=no, ${LIB_SOCKET})
+-      LIBS="$cmu_save_LIBS"
+-    fi
+-    AC_MSG_CHECKING(UCD SNMP libraries)
+-    AC_MSG_RESULT($with_snmp)
+-    LIB_UCDSNMP=""
+-    if test "$with_snmp" != no; then
+-      AC_DEFINE(HAVE_UCDSNMP,1,[Do we have UCD-SNMP support?])
+-      LIB_UCDSNMP="-lucdagent -lucdmibs -lsnmp"
+-      AC_CHECK_LIB(rpm, rpmdbOpen,
+-		 LIB_UCDSNMP="${LIB_UCDSNMP} -lrpm -lpopt",,-lpopt)
+-    fi
+-    AC_SUBST(LIB_UCDSNMP)
+-  fi
+-fi
+-
+-])
+-
++m4_include([cmulocal/berkdb.m4])
++m4_include([cmulocal/bsd_sockets.m4])
++m4_include([cmulocal/c-attribute.m4])
++m4_include([cmulocal/c-fpic.m4])
++m4_include([cmulocal/cyrus.m4])
++m4_include([cmulocal/ipv6.m4])
++m4_include([cmulocal/libwrap.m4])
++m4_include([cmulocal/sasl2.m4])
++m4_include([cmulocal/ucdsnmp.m4])
+diff -urNad complete.dpatch/configure.in /tmp/dpep.IJ03bC/complete.dpatch/configure.in
+--- complete.dpatch/configure.in	2005-01-19 00:46:00.000000000 +0100
++++ /tmp/dpep.IJ03bC/complete.dpatch/configure.in	2005-11-10 18:42:37.579406942 +0100
+@@ -51,6 +51,11 @@
+ 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],
+ 	[AC_DEFINE_UNQUOTED(EXTRA_IDENT,"$withval", [Extra version information for imap/version.h])])
+@@ -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__
+@@ -1216,7 +1223,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_ */

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/07-update_aclocal_and_configure.in.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/08-clean_socket_closes.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/08-clean_socket_closes.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/08-clean_socket_closes.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/08-clean_socket_closes.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,90 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 08-clean_socket_closes.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Cleanly close sockets
+
+ at DPATCH@
+diff -urNad complete.dpatch/imap/backend.c /tmp/dpep.FbBq2t/complete.dpatch/imap/backend.c
+--- complete.dpatch/imap/backend.c	2005-02-14 07:39:55.000000000 +0100
++++ /tmp/dpep.FbBq2t/complete.dpatch/imap/backend.c	2005-11-11 00:01:15.843304837 +0100
+@@ -382,6 +382,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;
+ 	}
+diff -urNad complete.dpatch/imap/fud.c /tmp/dpep.FbBq2t/complete.dpatch/imap/fud.c
+--- complete.dpatch/imap/fud.c	2005-11-10 21:12:04.000000000 +0100
++++ /tmp/dpep.FbBq2t/complete.dpatch/imap/fud.c	2005-11-11 00:01:58.076164940 +0100
+@@ -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);
+ }
+ 
+diff -urNad complete.dpatch/imap/imapd.c /tmp/dpep.FbBq2t/complete.dpatch/imap/imapd.c
+--- complete.dpatch/imap/imapd.c	2005-11-10 21:12:04.000000000 +0100
++++ /tmp/dpep.FbBq2t/complete.dpatch/imap/imapd.c	2005-11-11 00:04:47.146591300 +0100
+@@ -765,6 +765,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();
+ 
+diff -urNad complete.dpatch/imap/lmtpd.c /tmp/dpep.FbBq2t/complete.dpatch/imap/lmtpd.c
+--- complete.dpatch/imap/lmtpd.c	2004-12-17 17:32:15.000000000 +0100
++++ /tmp/dpep.FbBq2t/complete.dpatch/imap/lmtpd.c	2005-11-11 00:02:48.172254190 +0100
+@@ -501,6 +501,9 @@
+ 
+     cyrus_done();
+ 
++    /* shutdown socket nicely */
++    cyrus_reset_stdio();
++
+     exit(code);
+ }
+ 
+diff -urNad complete.dpatch/imap/pop3d.c /tmp/dpep.FbBq2t/complete.dpatch/imap/pop3d.c
+--- complete.dpatch/imap/pop3d.c	2005-11-10 21:07:23.000000000 +0100
++++ /tmp/dpep.FbBq2t/complete.dpatch/imap/pop3d.c	2005-11-11 00:03:22.702869236 +0100
+@@ -496,6 +496,9 @@
+ #endif
+ 
+     cyrus_done();
++    cyrus_close_sock(0);
++    cyrus_close_sock(1);
++    cyrus_close_sock(2);
+ 
+     exit(code);
+ }
+diff -urNad complete.dpatch/imap/proxyd.c /tmp/dpep.FbBq2t/complete.dpatch/imap/proxyd.c
+--- complete.dpatch/imap/proxyd.c	2005-11-10 21:12:04.000000000 +0100
++++ /tmp/dpep.FbBq2t/complete.dpatch/imap/proxyd.c	2005-11-11 00:04:04.761746266 +0100
+@@ -1443,6 +1443,9 @@
+ #endif
+ 
+     cyrus_done();
++    cyrus_close_sock(0);
++    cyrus_close_sock(1);
++    cyrus_close_sock(2);
+ 
+     exit(code);
+ }

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/08-clean_socket_closes.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/09-kerberos-ipv4-ipv6-kludge-removal.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/09-kerberos-ipv4-ipv6-kludge-removal.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/09-kerberos-ipv4-ipv6-kludge-removal.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/09-kerberos-ipv4-ipv6-kludge-removal.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,53 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 09-kerberos-ipv4-ipv6-kludge-removal.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Remove a kludge which turned IPv4 addresses in IPv6 address space back
+## DP: into real IPv4 addresses.
+
+ at DPATCH@
+diff -urNad complete.dpatch/imap/pop3d.c /tmp/dpep.PeS97g/complete.dpatch/imap/pop3d.c
+--- complete.dpatch/imap/pop3d.c	2005-11-11 00:11:13.000000000 +0100
++++ /tmp/dpep.PeS97g/complete.dpatch/imap/pop3d.c	2005-11-11 00:15:17.166894681 +0100
+@@ -522,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

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/09-kerberos-ipv4-ipv6-kludge-removal.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/10-fix_potential_overflows.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/10-fix_potential_overflows.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/10-fix_potential_overflows.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/10-fix_potential_overflows.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,198 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10-fix_potential_overflows.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: fix potential buffer overflows
+
+ at DPATCH@
+diff -urNad complete.dpatch/imap/ctl_mboxlist.c /tmp/dpep.8ZEecd/complete.dpatch/imap/ctl_mboxlist.c
+--- complete.dpatch/imap/ctl_mboxlist.c	2004-05-22 05:45:48.000000000 +0200
++++ /tmp/dpep.8ZEecd/complete.dpatch/imap/ctl_mboxlist.c	2005-11-10 20:38:08.142040412 +0100
+@@ -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;
+diff -urNad complete.dpatch/imap/fud.c /tmp/dpep.8ZEecd/complete.dpatch/imap/fud.c
+--- complete.dpatch/imap/fud.c	2004-12-17 17:32:07.000000000 +0100
++++ /tmp/dpep.8ZEecd/complete.dpatch/imap/fud.c	2005-11-10 20:38:44.863358638 +0100
+@@ -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 */
+diff -urNad complete.dpatch/imap/global.c /tmp/dpep.8ZEecd/complete.dpatch/imap/global.c
+--- complete.dpatch/imap/global.c	2004-11-23 18:40:15.000000000 +0100
++++ /tmp/dpep.8ZEecd/complete.dpatch/imap/global.c	2005-11-10 20:40:02.897537018 +0100
+@@ -467,7 +467,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 */
+diff -urNad complete.dpatch/imap/idle_idled.c /tmp/dpep.8ZEecd/complete.dpatch/imap/idle_idled.c
+--- complete.dpatch/imap/idle_idled.c	2003-10-22 22:05:11.000000000 +0200
++++ /tmp/dpep.8ZEecd/complete.dpatch/imap/idle_idled.c	2005-11-10 20:40:56.266272619 +0100
+@@ -109,11 +109,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;
+diff -urNad complete.dpatch/imap/index.c /tmp/dpep.8ZEecd/complete.dpatch/imap/index.c
+--- complete.dpatch/imap/index.c	2005-02-14 17:42:08.000000000 +0100
++++ /tmp/dpep.8ZEecd/complete.dpatch/imap/index.c	2005-11-10 20:42:49.720157772 +0100
+@@ -3278,9 +3278,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:
+diff -urNad complete.dpatch/imap/mboxlist.h /tmp/dpep.8ZEecd/complete.dpatch/imap/mboxlist.h
+--- complete.dpatch/imap/mboxlist.h	2004-03-17 19:07:49.000000000 +0100
++++ /tmp/dpep.8ZEecd/complete.dpatch/imap/mboxlist.h	2005-11-10 20:43:33.110906719 +0100
+@@ -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 */
+diff -urNad complete.dpatch/imap/message.c /tmp/dpep.8ZEecd/complete.dpatch/imap/message.c
+--- complete.dpatch/imap/message.c	2005-11-10 18:19:03.000000000 +0100
++++ /tmp/dpep.8ZEecd/complete.dpatch/imap/message.c	2005-11-10 20:44:17.400567516 +0100
+@@ -795,7 +795,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';
+diff -urNad complete.dpatch/imap/mupdate.h /tmp/dpep.8ZEecd/complete.dpatch/imap/mupdate.h
+--- complete.dpatch/imap/mupdate.h	2003-12-10 17:07:03.000000000 +0100
++++ /tmp/dpep.8ZEecd/complete.dpatch/imap/mupdate.h	2005-11-10 20:44:52.257152442 +0100
+@@ -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;
+diff -urNad complete.dpatch/imap/proxyd.c /tmp/dpep.8ZEecd/complete.dpatch/imap/proxyd.c
+--- complete.dpatch/imap/proxyd.c	2005-11-10 18:19:03.000000000 +0100
++++ /tmp/dpep.8ZEecd/complete.dpatch/imap/proxyd.c	2005-11-10 20:46:06.823846583 +0100
+@@ -1277,7 +1277,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;
+diff -urNad complete.dpatch/imtest/imtest.c /tmp/dpep.8ZEecd/complete.dpatch/imtest/imtest.c
+--- complete.dpatch/imtest/imtest.c	2005-11-10 18:19:03.000000000 +0100
++++ /tmp/dpep.8ZEecd/complete.dpatch/imtest/imtest.c	2005-11-10 20:47:18.417831766 +0100
+@@ -1225,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);
+diff -urNad complete.dpatch/master/master.c /tmp/dpep.8ZEecd/complete.dpatch/master/master.c
+--- complete.dpatch/master/master.c	2005-11-10 18:19:03.000000000 +0100
++++ /tmp/dpep.8ZEecd/complete.dpatch/master/master.c	2005-11-10 20:50:59.813138032 +0100
+@@ -222,13 +222,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]);
++	path[size-1] = '\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]);
+ }
+ 
+ void get_statsock(int filedes[2])
+diff -urNad complete.dpatch/master/masterconf.c /tmp/dpep.8ZEecd/complete.dpatch/master/masterconf.c
+--- complete.dpatch/master/masterconf.c	2003-11-25 18:37:19.000000000 +0100
++++ /tmp/dpep.8ZEecd/complete.dpatch/master/masterconf.c	2005-11-10 20:53:17.940602394 +0100
+@@ -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++;
+ 	    }
+ 	}
+diff -urNad complete.dpatch/notifyd/notifyd.c /tmp/dpep.8ZEecd/complete.dpatch/notifyd/notifyd.c
+--- complete.dpatch/notifyd/notifyd.c	2004-12-17 17:32:25.000000000 +0100
++++ /tmp/dpep.8ZEecd/complete.dpatch/notifyd/notifyd.c	2005-11-10 20:55:15.058125035 +0100
+@@ -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);
+ 	}

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/10-fix_potential_overflows.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/11-fix_syslog_prefix.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/11-fix_syslog_prefix.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/11-fix_syslog_prefix.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/11-fix_syslog_prefix.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,68 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 11-fix_syslog_prefix.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Make sure all programs log (to syslog) with "cyrus/<program>" as the
+## DP: log prefix.
+
+ at DPATCH@
+diff -urNad complete.dpatch/imap/global.c /tmp/dpep.rKpUur/complete.dpatch/imap/global.c
+--- complete.dpatch/imap/global.c	2005-11-11 13:12:47.000000000 +0100
++++ /tmp/dpep.rKpUur/complete.dpatch/imap/global.c	2005-11-11 13:13:53.042398971 +0100
+@@ -93,6 +93,9 @@
+ struct cyrusdb_backend *config_ptscache_db;
+ #endif
+ 
++/* 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)
+@@ -120,7 +123,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);
+diff -urNad complete.dpatch/ptclient/ptexpire.c /tmp/dpep.rKpUur/complete.dpatch/ptclient/ptexpire.c
+--- complete.dpatch/ptclient/ptexpire.c	2004-05-26 18:05:59.000000000 +0200
++++ /tmp/dpep.rKpUur/complete.dpatch/ptclient/ptexpire.c	2005-11-11 13:15:41.839710005 +0100
+@@ -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) {
+diff -urNad complete.dpatch/ptclient/test.c /tmp/dpep.rKpUur/complete.dpatch/ptclient/test.c
+--- complete.dpatch/ptclient/test.c	2003-10-22 20:50:29.000000000 +0200
++++ /tmp/dpep.rKpUur/complete.dpatch/ptclient/test.c	2005-11-11 13:16:19.409019154 +0100
+@@ -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],
+diff -urNad complete.dpatch/ptclient/test2.c /tmp/dpep.rKpUur/complete.dpatch/ptclient/test2.c
+--- complete.dpatch/ptclient/test2.c	2003-10-22 20:50:29.000000000 +0200
++++ /tmp/dpep.rKpUur/complete.dpatch/ptclient/test2.c	2005-11-11 13:16:39.749020971 +0100
+@@ -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",

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/11-fix_syslog_prefix.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/12-fix_timeout_handling.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/12-fix_timeout_handling.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/12-fix_timeout_handling.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/12-fix_timeout_handling.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,457 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 12-fix_timeout_handling.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: fixes timeout handling
+
+ at DPATCH@
+diff -urNad complete.dpatch/imap/signals.c /tmp/dpep.9pxAsS/complete.dpatch/imap/signals.c
+--- complete.dpatch/imap/signals.c	2005-02-14 17:26:50.000000000 +0100
++++ /tmp/dpep.9pxAsS/complete.dpatch/imap/signals.c	2005-11-11 14:10:07.056723830 +0100
+@@ -50,7 +50,7 @@
+ #include "xmalloc.h"
+ #include "exitcodes.h"
+ 
+-static int gotsignal = 0;
++static volatile int gotsignal = 0;
+ 
+ static void sighandler(int sig)
+ {
+diff -urNad complete.dpatch/lib/lock.h /tmp/dpep.9pxAsS/complete.dpatch/lib/lock.h
+--- complete.dpatch/lib/lock.h	2003-02-13 21:15:40.000000000 +0100
++++ /tmp/dpep.9pxAsS/complete.dpatch/lib/lock.h	2005-11-11 14:10:07.056723830 +0100
+@@ -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,
+diff -urNad complete.dpatch/lib/lock_fcntl.c /tmp/dpep.9pxAsS/complete.dpatch/lib/lock_fcntl.c
+--- complete.dpatch/lib/lock_fcntl.c	2003-02-13 21:15:40.000000000 +0100
++++ /tmp/dpep.9pxAsS/complete.dpatch/lib/lock_fcntl.c	2005-11-11 14:10:07.057723732 +0100
+@@ -47,11 +47,43 @@
+ #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',
+  * opened for reading and writing on the file named 'filename'.  If
+@@ -65,12 +97,10 @@
+  * 'failaction' is provided, it is filled in with a pointer to a fixed
+  * string naming the action that failed.
+  *
++ * We use POSIX semanthics and alarm() to avoid deadlocks
++ *
+  */
+-int lock_reopen(fd, filename, sbuf, failaction)
+-int fd;
+-const char *filename;
+-struct stat *sbuf;
+-const char **failaction;
++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 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;
++	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 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;
++	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;
+     }
++    return 0;
+ }
+ 
+ /*
+- * 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)
+ { 
+@@ -209,5 +275,6 @@
+         /* xxx help! */
+         return -1;
+     }
++    return 0;
+ }
+ 
+diff -urNad complete.dpatch/lib/lock_flock.c /tmp/dpep.9pxAsS/complete.dpatch/lib/lock_flock.c
+--- complete.dpatch/lib/lock_flock.c	2003-02-13 21:15:41.000000000 +0100
++++ /tmp/dpep.9pxAsS/complete.dpatch/lib/lock_flock.c	2005-11-11 14:10:07.057723732 +0100
+@@ -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
+@@ -54,6 +56,36 @@
+ 
+ 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',
+  * opened for reading and writing on the file named 'filename'.  If
+@@ -67,12 +99,10 @@
+  * 'failaction' is provided, it is filled in with a pointer to a fixed
+  * string naming the action that failed.
+  *
++ * We use POSIX semanthics and alarm() to avoid deadlocks
++ *
+  */
+-int lock_reopen(fd, filename, sbuf, failaction)
+-int fd;
+-const char *filename;
+-struct stat *sbuf;
+-const char **failaction;
++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 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;
++	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 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;
++	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;
+ }
+ 

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/12-fix_timeout_handling.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/13-master_process_handling.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/13-master_process_handling.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/13-master_process_handling.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/13-master_process_handling.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,245 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 13-master_process_handling.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fixes process (child) handling in master process
+
+ at DPATCH@
+diff -urNad complete.dpatch/master/master.c /tmp/dpep.NKIIR9/complete.dpatch/master/master.c
+--- complete.dpatch/master/master.c	2005-11-11 17:03:04.000000000 +0100
++++ /tmp/dpep.NKIIR9/complete.dpatch/master/master.c	2005-11-11 17:04:39.273704930 +0100
+@@ -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);
+ 
+@@ -915,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,
+@@ -924,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;
+@@ -1079,6 +1081,36 @@
+     }
+ }
+ 
++/*
++ * 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) 
+ {
+     struct centry *c;
+@@ -1392,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;
+@@ -1405,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 {
+@@ -1413,6 +1446,7 @@
+ 	if (prefork > 1) prefork = 1;
+ 	Services[i].desired_workers = prefork;
+ 	Services[i].max_workers = 1;
++	Services[i].babysit = 0;
+     }
+     free(max);
+  
+@@ -1452,7 +1486,7 @@
+     if (!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);
+@@ -1506,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
+@@ -1521,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 */
+@@ -1544,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);
+@@ -1559,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++ ) {
+@@ -1648,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 */
+@@ -1683,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);
+@@ -2060,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;
++		}
++		if (r < 0) {
++		    syslog(LOG_ERR,
++			"error while receiving message from child %x: %m", i);
+ 		    continue;
+ 		}
+-		
+-		process_msg(i, &msg);
+ 	    }
+ 
+ 	    if (Services[i].exec &&
+diff -urNad complete.dpatch/master/master.h /tmp/dpep.NKIIR9/complete.dpatch/master/master.h
+--- complete.dpatch/master/master.h	2005-11-11 17:03:03.000000000 +0100
++++ /tmp/dpep.NKIIR9/complete.dpatch/master/master.h	2005-11-11 17:03:04.650994659 +0100
+@@ -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

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/13-master_process_handling.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/14-xmalloc.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/14-xmalloc.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/14-xmalloc.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/14-xmalloc.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,31 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 14-xmalloc.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix xmalloc usage
+
+ at DPATCH@
+diff -urNad complete.dpatch/lib/map_stupidshared.c /tmp/dpep.1Bc5Yw/complete.dpatch/lib/map_stupidshared.c
+--- complete.dpatch/lib/map_stupidshared.c	2003-10-22 20:50:12.000000000 +0200
++++ /tmp/dpep.1Bc5Yw/complete.dpatch/lib/map_stupidshared.c	2005-11-11 14:29:02.586035529 +0100
+@@ -52,6 +52,7 @@
+ #include <sys/stat.h>
+ #include <syslog.h>
+ 
++#include "xmalloc.h"
+ #include "map.h"
+ #include "exitcodes.h"
+ 
+diff -urNad complete.dpatch/lib/xmalloc.h /tmp/dpep.1Bc5Yw/complete.dpatch/lib/xmalloc.h
+--- complete.dpatch/lib/xmalloc.h	2003-10-22 20:50:12.000000000 +0200
++++ /tmp/dpep.1Bc5Yw/complete.dpatch/lib/xmalloc.h	2005-11-11 14:29:30.174327237 +0100
+@@ -65,7 +65,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 */

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/14-xmalloc.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/15-munge_8bit.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/15-munge_8bit.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/15-munge_8bit.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/15-munge_8bit.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,75 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 15_munge_8bit.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Add support for munge8bit
+
+ at DPATCH@
+diff -urNad complete.dpatch/imap/message.c /tmp/dpep.sh0ZiZ/complete.dpatch/imap/message.c
+--- complete.dpatch/imap/message.c	2004-09-16 19:58:54.000000000 +0200
++++ /tmp/dpep.sh0ZiZ/complete.dpatch/imap/message.c	2005-11-10 17:02:02.658034914 +0100
+@@ -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';
+diff -urNad complete.dpatch/imap/spool.c /tmp/dpep.sh0ZiZ/complete.dpatch/imap/spool.c
+--- complete.dpatch/imap/spool.c	2004-10-27 22:40:50.000000000 +0200
++++ /tmp/dpep.sh0ZiZ/complete.dpatch/imap/spool.c	2005-11-10 17:02:02.658034914 +0100
+@@ -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';
+diff -urNad complete.dpatch/lib/imapoptions /tmp/dpep.sh0ZiZ/complete.dpatch/lib/imapoptions
+--- complete.dpatch/lib/imapoptions	2004-07-21 21:07:45.000000000 +0200
++++ /tmp/dpep.sh0ZiZ/complete.dpatch/lib/imapoptions	2005-11-10 17:02:02.659034816 +0100
+@@ -458,6 +458,11 @@
+ { "mboxlist_db", "skiplist", STRINGLIST("flat", "berkeley", "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 }
+ /* The max number of connections that a mupdate process will allow, this
+@@ -670,9 +675,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

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/15-munge_8bit.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/16-fix_mib.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/16-fix_mib.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/16-fix_mib.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/16-fix_mib.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,30 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 16-fix_mib.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix MIB file for cyrus
+
+ at DPATCH@
+diff -urNad complete.dpatch/master/CYRUS-MASTER.mib /tmp/dpep.McEbU0/complete.dpatch/master/CYRUS-MASTER.mib
+--- complete.dpatch/master/CYRUS-MASTER.mib	2001-08-14 18:11:26.000000000 +0200
++++ /tmp/dpep.McEbU0/complete.dpatch/master/CYRUS-MASTER.mib	2005-11-10 17:11:15.237608454 +0100
+@@ -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

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/16-fix_mib.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/17-fix_tail_syntax_in_xversion.h.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/17-fix_tail_syntax_in_xversion.h.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/17-fix_tail_syntax_in_xversion.h.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/17-fix_tail_syntax_in_xversion.h.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,16 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 17-fix_tail_syntax_in_xversion.h.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: fix tail syntax in xversion.h (use "tail -n 1" instead of "tail -1")
+
+ at DPATCH@
+diff -urNad complete.dpatch/imap/xversion.sh /tmp/dpep.gLdzBq/complete.dpatch/imap/xversion.sh
+--- complete.dpatch/imap/xversion.sh	2003-10-22 20:03:00.000000000 +0200
++++ /tmp/dpep.gLdzBq/complete.dpatch/imap/xversion.sh	2005-11-10 17:14:52.208238481 +0100
+@@ -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

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/17-fix_tail_syntax_in_xversion.h.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/18-fix_strlen_return_type.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/18-fix_strlen_return_type.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/18-fix_strlen_return_type.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/18-fix_strlen_return_type.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,606 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 18-fix_strlen_return_type.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix return type of strlen calls and snprintf/prot_printf format
+## DP: strings.
+
+ at DPATCH@
+diff -urNad complete.dpatch/imap/imapd.c /tmp/dpep.2wtF9E/complete.dpatch/imap/imapd.c
+--- complete.dpatch/imap/imapd.c	2005-11-11 16:17:00.000000000 +0100
++++ /tmp/dpep.2wtF9E/complete.dpatch/imap/imapd.c	2005-11-11 16:17:00.679913340 +0100
+@@ -6071,8 +6071,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);
+@@ -6122,9 +6122,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') {
+@@ -6199,11 +6199,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);
+@@ -6317,11 +6317,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",
+@@ -6355,7 +6355,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);
+@@ -6401,8 +6402,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,
+@@ -6441,8 +6442,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,
+@@ -6637,9 +6638,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, " \
+@@ -7183,7 +7185,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);
+     }
+@@ -7213,7 +7215,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);
+     }
+diff -urNad complete.dpatch/imap/mbdump.c /tmp/dpep.2wtF9E/complete.dpatch/imap/mbdump.c
+--- complete.dpatch/imap/mbdump.c	2005-11-11 16:16:59.000000000 +0100
++++ /tmp/dpep.2wtF9E/complete.dpatch/imap/mbdump.c	2005-11-11 16:17:00.679913340 +0100
+@@ -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,
+diff -urNad complete.dpatch/imap/message.c /tmp/dpep.2wtF9E/complete.dpatch/imap/message.c
+--- complete.dpatch/imap/message.c	2005-11-11 16:17:00.000000000 +0100
++++ /tmp/dpep.2wtF9E/complete.dpatch/imap/message.c	2005-11-11 16:17:00.681913145 +0100
+@@ -2060,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;
+diff -urNad complete.dpatch/imap/mupdate-client.c /tmp/dpep.2wtF9E/complete.dpatch/imap/mupdate-client.c
+--- complete.dpatch/imap/mupdate-client.c	2005-11-11 16:16:59.000000000 +0100
++++ /tmp/dpep.2wtF9E/complete.dpatch/imap/mupdate-client.c	2005-11-11 16:17:00.681913145 +0100
+@@ -331,9 +331,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) {
+@@ -356,9 +358,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) {
+@@ -381,9 +384,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) {
+@@ -406,8 +410,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) {
+@@ -475,8 +479,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));
+ 
+@@ -508,8 +512,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++);
+diff -urNad complete.dpatch/imap/mupdate.c /tmp/dpep.2wtF9E/complete.dpatch/imap/mupdate.c
+--- complete.dpatch/imap/mupdate.c	2005-11-11 16:16:59.000000000 +0100
++++ /tmp/dpep.2wtF9E/complete.dpatch/imap/mupdate.c	2005-11-11 16:17:00.682913047 +0100
+@@ -1589,20 +1589,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);
+@@ -1644,17 +1644,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:
+diff -urNad complete.dpatch/imap/proxyd.c /tmp/dpep.2wtF9E/complete.dpatch/imap/proxyd.c
+--- complete.dpatch/imap/proxyd.c	2005-11-11 16:17:00.000000000 +0100
++++ /tmp/dpep.2wtF9E/complete.dpatch/imap/proxyd.c	2005-11-11 16:17:00.685912753 +0100
+@@ -2888,7 +2888,8 @@
+ 	if (!s) r = IMAP_SERVER_UNAVAILABLE;
+     }
+     if (!r) {
+-	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 (!pipe_command(s, 16384)) {
+ 	    pipe_until_tag(s, tag, 0);
+ 	}
+@@ -2961,8 +2962,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);
+@@ -3192,8 +3193,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];
+@@ -3346,7 +3348,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 */;;) {
+@@ -3576,8 +3579,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 */
+ 	
+@@ -3617,8 +3620,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 */
+ 
+@@ -3719,17 +3722,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);
+@@ -3745,9 +3748,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 */
+ 	
+@@ -3782,8 +3785,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 */
+@@ -3852,9 +3855,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 */
+@@ -3943,14 +3946,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 {
+@@ -4182,15 +4185,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 */
+@@ -4290,8 +4293,8 @@
+ 	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;
+@@ -4517,8 +4520,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);
+ 	}
+@@ -4658,7 +4661,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);
+     }
+@@ -4686,7 +4689,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);
+     }
+diff -urNad complete.dpatch/imtest/imtest.c /tmp/dpep.2wtF9E/complete.dpatch/imtest/imtest.c
+--- complete.dpatch/imtest/imtest.c	2005-11-11 16:17:00.000000000 +0100
++++ /tmp/dpep.2wtF9E/complete.dpatch/imtest/imtest.c	2005-11-11 17:01:17.683492575 +0100
+@@ -625,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);
+     }
+@@ -1769,7 +1769,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);
+     
+diff -urNad complete.dpatch/master/master.c /tmp/dpep.2wtF9E/complete.dpatch/master/master.c
+--- complete.dpatch/master/master.c	2005-11-11 16:17:00.000000000 +0100
++++ /tmp/dpep.2wtF9E/complete.dpatch/master/master.c	2005-11-11 16:17:00.688912460 +0100
+@@ -1889,7 +1889,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) {
+diff -urNad complete.dpatch/timsieved/actions.c /tmp/dpep.2wtF9E/complete.dpatch/timsieved/actions.c
+--- complete.dpatch/timsieved/actions.c	2005-11-11 16:16:59.000000000 +0100
++++ /tmp/dpep.2wtF9E/complete.dpatch/timsieved/actions.c	2005-11-11 16:17:00.688912460 +0100
+@@ -353,7 +353,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);

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/18-fix_strlen_return_type.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/19-fix_tls_ssl.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/19-fix_tls_ssl.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/19-fix_tls_ssl.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/19-fix_tls_ssl.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,78 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 19-fix_tls_errormessage.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Make TLS/SSL error message more informative
+
+ at DPATCH@
+diff -urNad complete.dpatch/imap/tls.c /tmp/dpep.uKZhrg/complete.dpatch/imap/tls.c
+--- complete.dpatch/imap/tls.c	2005-11-11 15:31:40.000000000 +0100
++++ /tmp/dpep.uKZhrg/complete.dpatch/imap/tls.c	2005-11-11 15:31:41.926478833 +0100
+@@ -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;
+@@ -679,7 +679,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);
+@@ -1098,7 +1098,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);
+ 	}
+     }
+diff -urNad complete.dpatch/imtest/imtest.c /tmp/dpep.uKZhrg/complete.dpatch/imtest/imtest.c
+--- complete.dpatch/imtest/imtest.c	2005-11-11 15:31:41.000000000 +0100
++++ /tmp/dpep.uKZhrg/complete.dpatch/imtest/imtest.c	2005-11-11 15:31:57.244983198 +0100
+@@ -63,6 +63,7 @@
+ 
+ #include <limits.h>
+ #include <unistd.h>
++#include <ctype.h>
+ 
+ #include <netinet/in.h>
+ #include <sys/un.h>
+@@ -418,7 +419,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;
+@@ -531,7 +532,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);
+diff -urNad complete.dpatch/lib/imclient.c /tmp/dpep.uKZhrg/complete.dpatch/lib/imclient.c
+--- complete.dpatch/lib/imclient.c	2005-11-11 15:31:40.000000000 +0100
++++ /tmp/dpep.uKZhrg/complete.dpatch/lib/imclient.c	2005-11-11 15:31:41.928478637 +0100
+@@ -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);

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/19-fix_tls_ssl.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/21-fix_config-parsing.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/21-fix_config-parsing.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/21-fix_config-parsing.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/21-fix_config-parsing.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,37 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 21-fix_config-parsing.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix parsing of master.conf
+
+ at DPATCH@
+diff -urNad complete.dpatch/master/masterconf.c /tmp/dpep.CfovCR/complete.dpatch/master/masterconf.c
+--- complete.dpatch/master/masterconf.c	2005-11-11 15:25:37.000000000 +0100
++++ /tmp/dpep.CfovCR/complete.dpatch/master/masterconf.c	2005-11-11 15:27:02.084797577 +0100
+@@ -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;
+ }
+ 

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/21-fix_config-parsing.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/cyrus-imapd-2.2.12/debian/patches/22-imapd_index_check.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/22-imapd_index_check.dpatch?view=auto&rev=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/22-imapd_index_check.dpatch (added)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/22-imapd_index_check.dpatch Fri Nov 11 17:15:40 2005
@@ -1,0 +1,51 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 22-imapd_index_check.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix usage of index_check()
+
+ at DPATCH@
+diff -urNad complete.dpatch/imap/imapd.c /tmp/dpep.SYrYMP/complete.dpatch/imap/imapd.c
+--- complete.dpatch/imap/imapd.c	2005-11-11 16:01:19.000000000 +0100
++++ /tmp/dpep.SYrYMP/complete.dpatch/imap/imapd.c	2005-11-11 16:01:37.190206572 +0100
+@@ -3175,8 +3175,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,
+@@ -3191,6 +3191,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,
+@@ -3309,7 +3312,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,
+@@ -3441,7 +3445,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);
+     }
+ 

Propchange: trunk/cyrus-imapd-2.2.12/debian/patches/22-imapd_index_check.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Modified: trunk/cyrus-imapd-2.2.12/debian/patches/25_update_install-sh.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/25_update_install-sh.dpatch?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/debian/patches/25_update_install-sh.dpatch&r1=172&p2=trunk/cyrus-imapd-2.2.12/debian/patches/25_update_install-sh.dpatch&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/25_update_install-sh.dpatch (original)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/25_update_install-sh.dpatch Fri Nov 11 17:15:40 2005
@@ -2,7 +2,7 @@
 ## 25_update_install.sh.dpatch by Sven Mueller <debian at incase.de>
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
-## DP: No description.
+## DP: update install-sh to a more recent version
 
 @DPATCH@
 diff -urN cyrus-imapd-2.2.12/install-sh cyrus-imapd-2.2.12~/install-sh

Modified: trunk/cyrus-imapd-2.2.12/debian/patches/40_rehash_fix_pathes.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/40_rehash_fix_pathes.dpatch?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/debian/patches/40_rehash_fix_pathes.dpatch&r1=172&p2=trunk/cyrus-imapd-2.2.12/debian/patches/40_rehash_fix_pathes.dpatch&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/40_rehash_fix_pathes.dpatch (original)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/40_rehash_fix_pathes.dpatch Fri Nov 11 17:15:40 2005
@@ -2,7 +2,7 @@
 ## 40_rehash_fix_pathes.dpatch by Sven Mueller <debian at incase.de>
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
-## DP: No description.
+## DP: Fix paths in tools/rehash
 
 @DPATCH@
 diff -urNad cyrus-imapd-2.2.12/tools/rehash /tmp/dpep.cNgMuy/cyrus-imapd-2.2.12/tools/rehash

Modified: trunk/cyrus-imapd-2.2.12/debian/patches/45-kolab2-annotations.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/45-kolab2-annotations.dpatch?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/debian/patches/45-kolab2-annotations.dpatch&r1=172&p2=trunk/cyrus-imapd-2.2.12/debian/patches/45-kolab2-annotations.dpatch&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/45-kolab2-annotations.dpatch (original)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/45-kolab2-annotations.dpatch Fri Nov 11 17:15:40 2005
@@ -2,7 +2,7 @@
 ## 45-kolab2-annotations.dpatch by Sven Mueller <debian at incase.de>
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
-## DP: No description.
+## DP: Add kolab2 compatible annotation functionality
 
 @DPATCH@
 diff -urNad cyrus22-imapd-2.2.12/imap/annotate.c /tmp/dpep.AQbIR0/cyrus22-imapd-2.2.12/imap/annotate.c

Modified: trunk/cyrus-imapd-2.2.12/debian/patches/60-lower-poptimeout-minimum.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/60-lower-poptimeout-minimum.dpatch?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/debian/patches/60-lower-poptimeout-minimum.dpatch&r1=172&p2=trunk/cyrus-imapd-2.2.12/debian/patches/60-lower-poptimeout-minimum.dpatch&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/60-lower-poptimeout-minimum.dpatch (original)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/60-lower-poptimeout-minimum.dpatch Fri Nov 11 17:15:40 2005
@@ -2,7 +2,11 @@
 ## 40-lower-poptimeout-minimum.dpatch by Sven Mueller <debian at incase.de>
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
-## DP: No description.
+## DP: Lower the minimum timeout for POP3 locks
+## DP: NOTE: Though this patch enables you to lower POP3 lock timeouts to 
+## DP: less than 10 minutes, the corresponding RFC REQUIRES that the timeout
+## DP: is not shorter than 10 minutes. You may run into problems if you set
+## DP: Timeouts below that value.
 
 @DPATCH@
 diff -urNad cyrus-imapd-2.2.12/imap/pop3d.c /tmp/dpep.6Vbjgo/cyrus-imapd-2.2.12/imap/pop3d.c

Modified: trunk/cyrus-imapd-2.2.12/debian/patches/65-sieveshell-enhancements.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/65-sieveshell-enhancements.dpatch?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/debian/patches/65-sieveshell-enhancements.dpatch&r1=172&p2=trunk/cyrus-imapd-2.2.12/debian/patches/65-sieveshell-enhancements.dpatch&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/65-sieveshell-enhancements.dpatch (original)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/65-sieveshell-enhancements.dpatch Fri Nov 11 17:15:40 2005
@@ -2,13 +2,45 @@
 ## 65-sieveshell-enhancements.dpatch by Sven Mueller <debian at incase.de>
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
-## DP: No description.
+## DP: Adds some enhancements to sieveshell and fixes some paths.
 
 @DPATCH@
-diff -urNad cyrus-imapd-2.2.12/perl/sieve/scripts/sieveshell.pl /tmp/dpep.HDEJ6z/cyrus-imapd-2.2.12/perl/sieve/scripts/sieveshell.pl
---- cyrus-imapd-2.2.12/perl/sieve/scripts/sieveshell.pl	2005-05-25 01:02:44.000000000 +0200
-+++ /tmp/dpep.HDEJ6z/cyrus-imapd-2.2.12/perl/sieve/scripts/sieveshell.pl	2005-09-23 17:09:08.278440120 +0200
-@@ -62,7 +62,9 @@
+diff -urNad complete.dpatch/perl/imap/IMAP/Shell.pm /tmp/dpep.y9SjyR/complete.dpatch/perl/imap/IMAP/Shell.pm
+--- complete.dpatch/perl/imap/IMAP/Shell.pm	2004-01-15 15:35:35.000000000 +0100
++++ /tmp/dpep.y9SjyR/complete.dpatch/perl/imap/IMAP/Shell.pm	2005-11-10 21:01:05.451724741 +0100
+@@ -429,7 +429,7 @@
+ # programs, as opposed to things expected from within a program.)
+ sub shell {
+   my ($server, $port, $authz, $auth, $systemrc, $userrc, $dorc, $mech, $pw) =
+-    ('', 143, undef, $ENV{USER} || $ENV{LOGNAME}, '/usr/local/etc/cyradmrc.pl',
++    ('', 143, undef, $ENV{USER} || $ENV{LOGNAME}, '/etc/cyradmrc.pl',
+      "$ENV{HOME}/.cyradmrc.pl", 1, undef, undef);
+   GetOptions('user|u=s' => \$auth,
+ 	     'authz|z=s' => \$authz,
+@@ -459,7 +459,7 @@
+ 			  -rock => \$cyradm});
+     $cyradm->authenticate(-authz => $authz, -user => $auth,
+ 			  -mechanism => $mech, -password => $pw)
+-      or die "cyradm: cannot authenticate to server with $mech as $auth\n";
++      or die "cyradm: cannot authenticate to server" . (defined($mech)?" with $mech":"") . " as $auth\n";
+   }
+   my $fstk = [*STDIN, *STDOUT, *STDERR];
+   if ($dorc && $systemrc ne '' && -f $systemrc) {
+diff -urNad complete.dpatch/perl/sieve/lib/request.c /tmp/dpep.y9SjyR/complete.dpatch/perl/sieve/lib/request.c
+--- complete.dpatch/perl/sieve/lib/request.c	2003-02-13 21:15:53.000000000 +0100
++++ /tmp/dpep.y9SjyR/complete.dpatch/perl/sieve/lib/request.c	2005-11-10 21:01:05.451724741 +0100
+@@ -560,7 +560,6 @@
+ 	      char **refer_to, char **errstrp)
+ {
+   int res;
+-  mystring_t *str=NULL;
+   mystring_t *errstr=NULL;
+   lexstate_t state;
+   int ret = 0;
+diff -urNad complete.dpatch/perl/sieve/scripts/sieveshell.pl /tmp/dpep.y9SjyR/complete.dpatch/perl/sieve/scripts/sieveshell.pl
+--- complete.dpatch/perl/sieve/scripts/sieveshell.pl	2005-11-10 20:59:17.000000000 +0100
++++ /tmp/dpep.y9SjyR/complete.dpatch/perl/sieve/scripts/sieveshell.pl	2005-11-10 20:59:20.532035859 +0100
+@@ -60,7 +60,9 @@
  my $username = $ENV{USER};
  my $authname = $ENV{USER};
  my $realm = "";
@@ -18,7 +50,7 @@
  my $help = 0;
  my $man = 0;
  my $ret;
-@@ -70,7 +72,9 @@
+@@ -68,7 +70,9 @@
  GetOptions("a|authname:s" => \$authname,
      "u|username:s" => \$username,
      "r|realm:s" => \$realm,
@@ -28,7 +60,7 @@
      "help|?" => \$help,
      man => \$man) or pod2usage(2);
  pod2usage(1) if $help;
-@@ -85,20 +89,24 @@
+@@ -83,20 +87,24 @@
  my $filehandle;
  my $interactive;
  
@@ -63,7 +95,7 @@
  
  sub list_cb {
  
-@@ -123,6 +131,8 @@
+@@ -121,6 +129,8 @@
        return $authname;
    } elsif (($type eq "realm") && (defined $realm)) {
        return $realm;
@@ -72,7 +104,7 @@
    }
  
    my $ostty;
-@@ -173,6 +183,8 @@
+@@ -171,6 +181,8 @@
  
  my $term = Term::ReadLine->new("sieveshell");
  
@@ -81,7 +113,7 @@
  $term->ornaments(0);
  
  while(defined($_  = ($interactive ? $term->readline('> ') : <$filehandle>))){
-@@ -199,6 +211,9 @@
+@@ -197,6 +209,9 @@
  	my $errstr = sieve_get_error($obj);
  	$errstr = "unknown error" if(!defined($errstr));
  	print "upload failed: $errstr\n"; 
@@ -91,7 +123,7 @@
        }
      } elsif (($words[0] eq "list") || 
  	     ($words[0] eq "l") || 
-@@ -208,6 +223,9 @@
+@@ -206,6 +221,9 @@
  	    my $errstr = sieve_get_error($obj);
  	    $errstr = "unknown error" if(!defined($errstr));
  	    print "list failed: $errstr\n";
@@ -101,7 +133,7 @@
  	}
      } elsif (($words[0] eq "activate") || 
  	     ($words[0] eq "a")) {
-@@ -220,6 +238,9 @@
+@@ -218,6 +236,9 @@
  	    my $errstr = sieve_get_error($obj);
  	    $errstr = "unknown error" if(!defined($errstr));
  	    print "activate failed: $errstr\n";
@@ -111,7 +143,7 @@
  	}
      } elsif (($words[0] eq "deactivate") || 
  	     ($words[0] eq "da")) {
-@@ -232,6 +253,9 @@
+@@ -230,6 +251,9 @@
  	    my $errstr = sieve_get_error($obj);
  	    $errstr = "unknown error" if(!defined($errstr));
  	    print "deactivate failed: $errstr\n";
@@ -121,7 +153,7 @@
  	}
      } elsif (($words[0] eq "delete") || 
  	     ($words[0] eq "d")) {    
-@@ -244,6 +268,9 @@
+@@ -242,6 +266,9 @@
  	    my $errstr = sieve_get_error($obj);
  	    $errstr = "unknown error" if(!defined($errstr));
  	    print "delete failed: $errstr\n"; 
@@ -131,7 +163,7 @@
  	}
      } elsif (($words[0] eq "get") || 
  	     ($words[0] eq "g")) {
-@@ -257,25 +284,32 @@
+@@ -255,25 +282,32 @@
  	    my $errstr = sieve_get_error($obj);
  	    $errstr = "unknown error" if(!defined($errstr));
  	    print "get failed: $errstr\n"; 
@@ -165,7 +197,7 @@
  __END__
  
  =head1 NAME
-@@ -285,7 +319,8 @@
+@@ -283,7 +317,8 @@
  =head1 SYNOPSIS
  
  sieveshell [B<--user>=I<user>] [B<--authname>=I<authname>] 
@@ -175,7 +207,7 @@
  
  sieveshell B<--help>
  
-@@ -329,11 +363,21 @@
+@@ -327,11 +362,21 @@
  
  The realm to attempt authentication in.
  

Modified: trunk/cyrus-imapd-2.2.12/debian/patches/99-update-autoconf.dpatch
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/debian/patches/99-update-autoconf.dpatch?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/debian/patches/99-update-autoconf.dpatch&r1=172&p2=trunk/cyrus-imapd-2.2.12/debian/patches/99-update-autoconf.dpatch&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/debian/patches/99-update-autoconf.dpatch (original)
+++ trunk/cyrus-imapd-2.2.12/debian/patches/99-update-autoconf.dpatch Fri Nov 11 17:15:40 2005
@@ -2,7 +2,8 @@
 ## 99-update-autoconf.dpatch by Ondrej Sury <ondrej at debian.org>
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
-## DP: Update configure and config.h.in according to changes in other patches (drac and 64bit-quota)
+## DP: Update configure and config.h.in according to changes in other patches
+## DP: (drac and 64bit-quota)
 
 @DPATCH@
 diff -urN cyrus-imapd-2.2.12/config.h.in cyrus-imapd-2.2.12~/config.h.in

Modified: trunk/cyrus-imapd-2.2.12/doc/faq.html
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/doc/faq.html?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/doc/faq.html&r1=172&p2=trunk/cyrus-imapd-2.2.12/doc/faq.html&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/doc/faq.html (original)
+++ trunk/cyrus-imapd-2.2.12/doc/faq.html Fri Nov 11 17:15:40 2005
@@ -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/saslauthd/mux</tt>).
+user can access the unix domain socket (defaults to <tt>/var/run/mux</tt>).
 
 </dd>
 

Modified: trunk/cyrus-imapd-2.2.12/doc/install-virtdomains.html
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/doc/install-virtdomains.html?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/doc/install-virtdomains.html&r1=172&p2=trunk/cyrus-imapd-2.2.12/doc/install-virtdomains.html&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/doc/install-virtdomains.html (original)
+++ trunk/cyrus-imapd-2.2.12/doc/install-virtdomains.html Fri Nov 11 17:15:40 2005
@@ -99,10 +99,6 @@
 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: trunk/cyrus-imapd-2.2.12/imap/Makefile.in
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/Makefile.in?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/Makefile.in&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/Makefile.in&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/Makefile.in (original)
+++ trunk/cyrus-imapd-2.2.12/imap/Makefile.in Fri Nov 11 17:15:40 2005
@@ -72,7 +72,7 @@
 LIBS = $(IMAP_LIBS) $(IMAP_COM_ERR_LIBS)
 DEPLIBS = ../lib/libcyrus.a ../lib/libcyrus_min.a @DEPLIBS@
 
-CFLAGS = @CFLAGS@ @WARNERROR@
+CFLAGS = @CFLAGS@
 LDFLAGS = @LDFLAGS@ @COM_ERR_LDFLAGS@ 
 
 SHELL = /bin/sh

Modified: trunk/cyrus-imapd-2.2.12/imap/backend.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/backend.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/backend.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/backend.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/backend.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/backend.c Fri Nov 11 17:15:40 2005
@@ -382,7 +382,6 @@
 	    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: trunk/cyrus-imapd-2.2.12/imap/ctl_mboxlist.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/ctl_mboxlist.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/ctl_mboxlist.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/ctl_mboxlist.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/ctl_mboxlist.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/ctl_mboxlist.c Fri Nov 11 17:15:40 2005
@@ -479,7 +479,7 @@
     int r = 0;
     char buf[16384];
     int line = 0;
-    char last_commit[MAX_MAILBOX_NAME+1];
+    char last_commit[MAX_MAILBOX_NAME];
     char *key=NULL, *data=NULL;
     int keylen, datalen;
     int untilCommit = PER_COMMIT;

Modified: trunk/cyrus-imapd-2.2.12/imap/deliver.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/deliver.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/deliver.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/deliver.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/deliver.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/deliver.c Fri Nov 11 17:15:40 2005
@@ -99,7 +99,7 @@
 static void usage()
 {
     fprintf(stderr, 
-	    "421-4.3.0 usage: cyrdeliver [-C <alt_config> ] [-m mailbox]"
+	    "421-4.3.0 usage: deliver [-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: trunk/cyrus-imapd-2.2.12/imap/fud.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/fud.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/fud.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/fud.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/fud.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/fud.c Fri Nov 11 17:15:40 2005
@@ -119,9 +119,9 @@
 
         while(1) {
             /* For safety */
-            memset(username,'\0', sizeof(username));	
-            memset(mbox,'\0', sizeof(mbox));
-            memset(buf, '\0', sizeof(buf));
+            memset(username,'\0',MAXLOGNAME + MAXDOMNAME);	
+            memset(mbox,'\0',MAX_MAILBOX_NAME+1);
+            memset(buf, '\0', MAXLOGNAME + MAX_MAILBOX_NAME + 1);
 
 	    if (signals_poll() == SIGHUP) {
 		/* caught a SIGHUP, return */
@@ -158,15 +158,6 @@
     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: trunk/cyrus-imapd-2.2.12/imap/global.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/global.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/global.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/global.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/global.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/global.c Fri Nov 11 17:15:40 2005
@@ -93,9 +93,6 @@
 struct cyrusdb_backend *config_ptscache_db;
 #endif
 
-/* 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)
@@ -123,9 +120,7 @@
     
     /* xxx we lose here since we can't have the prefix until we load the
      * config file */
-    strncpy(syslog_prefix, "cyrus/", sizeof(syslog_prefix));
-    strncat(syslog_prefix, ident, sizeof(syslog_prefix) - 7);
-    openlog(syslog_prefix, LOG_PID, SYSLOG_FACILITY);
+    openlog(config_ident, LOG_PID, SYSLOG_FACILITY);
 
     /* Load configuration file.  This will set config_dir when it finds it */
     config_read(alt_config);
@@ -472,7 +467,7 @@
 {
     struct namespace namespace;
     char *acl;
-    char bufuser[MAX_MAILBOX_NAME+1], inboxname[MAX_MAILBOX_NAME+1];
+    char bufuser[MAX_MAILBOX_NAME], inboxname[MAX_MAILBOX_NAME];
     int r;
 
     /* Set namespace */

Modified: trunk/cyrus-imapd-2.2.12/imap/idle_idled.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/idle_idled.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/idle_idled.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/idle_idled.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/idle_idled.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/idle_idled.c Fri Nov 11 17:15:40 2005
@@ -109,11 +109,11 @@
     idle_remote.sun_family = AF_UNIX;
     idle_sock = config_getstring(IMAPOPT_IDLESOCKET);
     if (idle_sock) {	
-	strlcpy(idle_remote.sun_path, idle_sock, sizeof(idle_remote.sun_path));
+	strcpy(idle_remote.sun_path, idle_sock);
     }
     else {
-	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));
+	strcpy(idle_remote.sun_path, config_dir);
+	strcat(idle_remote.sun_path, FNAME_IDLE_SOCK);
     }
     idle_remote_len = sizeof(idle_remote.sun_family) +
 	strlen(idle_remote.sun_path) + 1;

Modified: trunk/cyrus-imapd-2.2.12/imap/imapd.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/imapd.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/imapd.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/imapd.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/imapd.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/imapd.c Fri Nov 11 17:15:40 2005
@@ -587,7 +587,6 @@
     return 0;
 }
 
-
 /*
  * run for each accepted connection
  */
@@ -766,10 +765,6 @@
 #ifdef HAVE_SSL
     tls_shutdown_serverengine();
 #endif
-    /* shutdown socket nicely */
-    cyrus_close_sock(0);
-    cyrus_close_sock(1);
-    cyrus_close_sock(2);
 
     cyrus_done();
 
@@ -3090,8 +3085,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,
@@ -3106,9 +3101,6 @@
     } 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,
@@ -3227,8 +3219,7 @@
 
     index_fetch(imapd_mailbox, msgno, 0, &fetchargs, &fetchedsomething);
 
-    index_check(imapd_mailbox, 0,
-       fetchedsomething && (fetchargs.fetchitems & FETCH_SETSEEN));
+    index_check(imapd_mailbox, 0, 0);
 
     if (fetchedsomething) {
 	prot_printf(imapd_out, "%s OK %s\r\n", tag,
@@ -3360,9 +3351,7 @@
     r = index_store(imapd_mailbox, sequence, usinguid, &storeargs,
 		    flag, nflags);
 
-    if(storeargs.seen || storeargs.operation==STORE_REPLACE) {
-	index_check(imapd_mailbox, usinguid, 1);
-    } else if (usinguid) {
+    if (usinguid) {
 	index_check(imapd_mailbox, 1, 0);
     }
 
@@ -6078,8 +6067,8 @@
     memset(&tmp, 0, sizeof(struct buf));
     memset(&user, 0, sizeof(struct buf));
 
-    prot_printf(pout, "ACL0 GETACL {%lu+}\r\n%s\r\n",
-		(unsigned long) strlen(mailbox), mailbox);
+    prot_printf(pout, "ACL0 GETACL {%d+}\r\n%s\r\n",
+		strlen(mailbox), mailbox);
 
     while(1) {
 	c = getword(pin, &tag);
@@ -6129,9 +6118,9 @@
 
 		snprintf(tagbuf, sizeof(tagbuf), "ACL%d", ++i);
 		
-		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);
+		prot_printf(pout, "%s DELETEACL {%d+}\r\n%s {%d+}\r\n%s\r\n",
+			    tagbuf, strlen(mailbox), mailbox,
+			    strlen(user.s), user.s);
 		if(c == '\r') {
 		    c = prot_getc(pin);
 		    if(c != '\n') {
@@ -6206,11 +6195,11 @@
 
 	snprintf(tag, sizeof(tag), "SACL%d", tagnum++);
 	
-	prot_printf(pout, "%s SETACL {%d+}\r\n%s {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
+	prot_printf(pout, "%s SETACL {%d+}\r\n%s {%d+}\r\n%s {%d+}\r\n%s\r\n",
 		    tag,
 		    mailboxlen, mailbox,
-		    (unsigned long) strlen(acl), acl,
-		    (unsigned long) strlen(rights), rights);
+		    strlen(acl), acl,
+		    strlen(rights), rights);
 
 	while(1) {
 	    c = getword(pin, &inbuf);
@@ -6324,11 +6313,11 @@
     if(!r) {
 	if(topart) {
 	    /* need to send partition as an atom */
-	    prot_printf(be->out, "LC1 LOCALCREATE {%lu+}\r\n%s %s\r\n",
-			(unsigned long) strlen(name), name, topart);
+	    prot_printf(be->out, "LC1 LOCALCREATE {%d+}\r\n%s %s\r\n",
+			strlen(name), name, topart);
 	} else {
-	    prot_printf(be->out, "LC1 LOCALCREATE {%lu+}\r\n%s\r\n",
-			(unsigned long) strlen(name), name);
+	    prot_printf(be->out, "LC1 LOCALCREATE {%d+}\r\n%s\r\n",
+			strlen(name), name);
 	}
 	r = getresult(be->in, "LC1");
 	if(r) syslog(LOG_ERR, "Could not move mailbox: %s, LOCALCREATE failed",
@@ -6362,8 +6351,7 @@
     if(!r) {
 	backout_mupdate = 1;
 
-	prot_printf(be->out, "D01 UNDUMP {%lu+}\r\n%s ",
-		    (unsigned long) strlen(name), name);
+	prot_printf(be->out, "D01 UNDUMP {%d+}\r\n%s ", strlen(name), name);
 
 	r = dump_mailbox(NULL, mailboxname, path, acl, 0, be->in, be->out,
 			 imapd_authstate);
@@ -6409,8 +6397,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 {%lu+}\r\n%s\r\n",
-			(unsigned long) strlen(name), name);
+	    prot_printf(be->out, "MP1 MUPDATEPUSH {%d+}\r\n%s\r\n",
+			strlen(name), name);
 	    rerr = getresult(be->in, "MP1");
 	    if(rerr) {
 		syslog(LOG_ERR,
@@ -6449,8 +6437,8 @@
     }
     if(r && backout_remotebox) {
 	rerr = 0;
-	prot_printf(be->out, "LD1 LOCALDELETE {%lu+}\r\n%s\r\n",
-		    (unsigned long) strlen(name), name);
+	prot_printf(be->out, "LD1 LOCALDELETE {%d+}\r\n%s\r\n",
+		    strlen(name), name);
 	rerr = getresult(be->in, "LD1");
  	if(rerr) {
 	    syslog(LOG_ERR,
@@ -6645,10 +6633,9 @@
 	    if(!r) {
 		/* note use of + to force the setting of a nonexistant
 		 * quotaroot */
-		prot_printf(be->out, "Q01 SETQUOTA {%lu+}\r\n" \
+		prot_printf(be->out, "Q01 SETQUOTA {%d+}\r\n" \
 			    "+%s (STORAGE %d)\r\n",
-			    (unsigned long) strlen(name)+1,
-			    name, quota.limit);
+			    strlen(name)+1, name, quota.limit);
 		r = getresult(be->in, "Q01");
 		if(r) syslog(LOG_ERR,
 			     "Could not move mailbox: %s, " \
@@ -7192,7 +7179,7 @@
 
     /* if it's too long, literal it */
     if (*p || len >= 1024) {
-	prot_printf(imapd_out, "{%lu}\r\n%s", (unsigned long) strlen(s), s);
+	prot_printf(imapd_out, "{%u}\r\n%s", strlen(s), s);
     } else {
 	prot_printf(imapd_out, "\"%s\"", s);
     }
@@ -7222,7 +7209,7 @@
 
     /* if it's too long, literal it */
     if (*p || len >= 1024) {
-	prot_printf(imapd_out, "{%lu}\r\n%s", (unsigned long) strlen(s), s);
+	prot_printf(imapd_out, "{%u}\r\n%s", strlen(s), s);
     } else {
 	prot_printf(imapd_out, "\"%s\"", s);
     }

Modified: trunk/cyrus-imapd-2.2.12/imap/index.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/index.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/index.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/index.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/index.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/index.c Fri Nov 11 17:15:40 2005
@@ -3278,17 +3278,9 @@
 		cur->from = get_localpart_addr(from + CACHE_ITEM_SIZE_SKIP);
 		break;
 	    case SORT_SUBJECT:
-		 {
-		     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 = index_extract_subject(subj + CACHE_ITEM_SIZE_SKIP,
+						   CACHE_ITEM_LEN(subj),
+						   &cur->is_refwd);
 		cur->xsubj_hash = strhash(cur->xsubj);
 		break;
 	    case SORT_TO:

Modified: trunk/cyrus-imapd-2.2.12/imap/lmtpd.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/lmtpd.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/lmtpd.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/lmtpd.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/lmtpd.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/lmtpd.c Fri Nov 11 17:15:40 2005
@@ -501,9 +501,6 @@
 
     cyrus_done();
 
-    /* shutdown socket nicely */
-    cyrus_reset_stdio();
-
     exit(code);
 }
 

Modified: trunk/cyrus-imapd-2.2.12/imap/mbdump.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/mbdump.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/mbdump.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/mbdump.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/mbdump.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/mbdump.c Fri Nov 11 17:15:40 2005
@@ -271,8 +271,8 @@
 
 	/* send filename, size, and contents */
 	if(first) {
-	    prot_printf(pout, "{%lu}\r\n",
-			(unsigned long) strlen(name));
+	    prot_printf(pout, "{%d}\r\n",
+			strlen(name));
 
 	    if(!tag) {
 		/* synchronize */
@@ -292,8 +292,8 @@
 
 	    first = 0;
 	} else {
-	    prot_printf(pout, " {%lu%s}\r\n%s {%lu%s}\r\n",
-			(unsigned long) strlen(name),
+	    prot_printf(pout, " {%d%s}\r\n%s {%lu%s}\r\n",
+			strlen(name),
 			(!tag ? "+" : ""),
 			name, len,
 			(!tag ? "+" : ""));
@@ -327,8 +327,8 @@
 
 	/* send filename, size, and contents */
 	if(first) {
-	    prot_printf(pout, "{%lu}\r\n",
-			(unsigned long) strlen(data_files[i]));
+	    prot_printf(pout, "{%d}\r\n",
+			strlen(data_files[i]));
 	    
 	    if(!tag) {
 		/* synchronize */
@@ -347,8 +347,8 @@
 			(!tag ? "+" : ""));
 	    first = 0;
 	} else {
-	    prot_printf(pout, " {%lu%s}\r\n%s {%lu%s}\r\n",
-			(unsigned long) strlen(data_files[i]),
+	    prot_printf(pout, " {%d%s}\r\n%s {%lu%s}\r\n",
+			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, " {%lu%s}\r\n%s {%lu%s}\r\n",
-					(unsigned long) strlen(ext_fname), 
+			    prot_printf(pout, " {%d%s}\r\n%s {%lu%s}\r\n",
+					strlen(ext_fname), 
 					(!tag ? "+" : ""),
 					ext_fname,
 					len,

Modified: trunk/cyrus-imapd-2.2.12/imap/mboxlist.h
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/mboxlist.h?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/mboxlist.h&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/mboxlist.h&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/mboxlist.h (original)
+++ trunk/cyrus-imapd-2.2.12/imap/mboxlist.h Fri Nov 11 17:15:40 2005
@@ -73,7 +73,7 @@
 
 /* each mailbox has the following data */
 struct mbox_entry {
-    char name[MAX_MAILBOX_NAME+1];
+    char name[MAX_MAILBOX_NAME];
     int mbtype;
     char partition[MAX_PARTITION_LEN];
 				/* holds remote machine for REMOTE mailboxes */

Modified: trunk/cyrus-imapd-2.2.12/imap/message.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/message.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/message.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/message.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/message.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/message.c Fri Nov 11 17:15:40 2005
@@ -227,7 +227,6 @@
     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) {
@@ -263,7 +262,7 @@
 			/* We have been configured to reject all mail of this
 			   form. */
 			if (!r) r = IMAP_MESSAGE_CONTAINS8BIT;
-		    } else if (munge8bit) {
+		    } else {
 			/* We have been configured to munge all mail of this
 			   form. */
 			*p = 'X';
@@ -796,7 +795,7 @@
     /* Save header value */
     len = hdrend - hdr;
     message_ibuf_ensure(ibuf, len+2);
-    strncpy(ibuf->end, hdr, len+1);
+    strncpy(ibuf->end, hdr, len);
     ibuf->end += len;
     *(ibuf->end)++ = '\r';
     *(ibuf->end)++ = '\n';
@@ -2060,7 +2059,7 @@
     if (*p || len >= 1024) {
 	/* Write out as literal */
 	char buf[100];
-	snprintf(buf, sizeof(buf), "{%lu}\r\n", (unsigned long) strlen(s));
+	snprintf(buf, sizeof(buf), "{%u}\r\n", 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: trunk/cyrus-imapd-2.2.12/imap/mupdate-client.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/mupdate-client.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/mupdate-client.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/mupdate-client.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/mupdate-client.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/mupdate-client.c Fri Nov 11 17:15:40 2005
@@ -331,11 +331,9 @@
     if (!handle->saslcompleted) return MUPDATE_NOAUTH;
 
     prot_printf(handle->pout,
-		"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);
+		"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);
 
     ret = mupdate_scarf(handle, mupdate_scarf_one, NULL, 1, &response);
     if (ret) {
@@ -358,10 +356,9 @@
     if (!handle->saslcompleted) return MUPDATE_NOAUTH;
 
     prot_printf(handle->pout,
-		"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);
+		"X%u RESERVE {%d+}\r\n%s {%d+}\r\n%s\r\n",
+		handle->tagn++, strlen(mailbox), mailbox, 
+		strlen(server), server);
 
     ret = mupdate_scarf(handle, mupdate_scarf_one, NULL, 1, &response);
     if (ret) {
@@ -384,10 +381,9 @@
     if (!handle->saslcompleted) return MUPDATE_NOAUTH;
 
     prot_printf(handle->pout,
-		"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);
+		"X%u DEACTIVATE {%d+}\r\n%s {%d+}\r\n%s\r\n",
+		handle->tagn++, strlen(mailbox), mailbox, 
+		strlen(server), server);
 
     ret = mupdate_scarf(handle, mupdate_scarf_one, NULL, 1, &response);
     if (ret) {
@@ -410,8 +406,8 @@
     if (!handle->saslcompleted) return MUPDATE_NOAUTH;
 
     prot_printf(handle->pout,
-		"X%u DELETE {%lu+}\r\n%s\r\n", handle->tagn++, 
-		(unsigned long) strlen(mailbox), mailbox);
+		"X%u DELETE {%d+}\r\n%s\r\n", handle->tagn++, 
+		strlen(mailbox), mailbox);
 
     ret = mupdate_scarf(handle, mupdate_scarf_one, NULL, 1, &response);
     if (ret) {
@@ -479,8 +475,8 @@
     if(!handle || !mailbox || !target) return MUPDATE_BADPARAM;
 
     prot_printf(handle->pout,
-		"X%u FIND {%lu+}\r\n%s\r\n", handle->tagn++, 
-		(unsigned long) strlen(mailbox), mailbox);
+		"X%u FIND {%d+}\r\n%s\r\n", handle->tagn++, 
+		strlen(mailbox), mailbox);
 
     memset(&(handle->mailboxdata_buf), 0, sizeof(handle->mailboxdata_buf));
 
@@ -512,8 +508,8 @@
 
     if(prefix) {
 	prot_printf(handle->pout,
-		    "X%u LIST {%lu+}\r\n%s\r\n", handle->tagn++,
-		    (unsigned long) strlen(prefix), prefix);
+		    "X%u LIST {%d+}\r\n%s\r\n", handle->tagn++,
+		    strlen(prefix), prefix);
     } else {
 	prot_printf(handle->pout,
 		    "X%u LIST\r\n", handle->tagn++);

Modified: trunk/cyrus-imapd-2.2.12/imap/mupdate.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/mupdate.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/mupdate.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/mupdate.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/mupdate.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/mupdate.c Fri Nov 11 17:15:40 2005
@@ -1589,20 +1589,20 @@
     pthread_mutex_unlock(&mailboxes_mutex); /* UNLOCK */
 
     if (m && m->t == SET_ACTIVE) {
-	prot_printf(C->pout, "%s MAILBOX {%lu+}\r\n%s {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
+	prot_printf(C->pout, "%s MAILBOX {%d+}\r\n%s {%d+}\r\n%s {%d+}\r\n%s\r\n",
 		    tag,
-		    (unsigned long) strlen(m->mailbox), m->mailbox,
-		    (unsigned long) strlen(m->server), m->server,
-		    (unsigned long) strlen(m->acl), m->acl);
+		    strlen(m->mailbox), m->mailbox,
+		    strlen(m->server), m->server,
+		    strlen(m->acl), m->acl);
     } else if (m && m->t == SET_RESERVE) {
-	prot_printf(C->pout, "%s RESERVE {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
+	prot_printf(C->pout, "%s RESERVE {%d+}\r\n%s {%d+}\r\n%s\r\n",
 		    tag,
-		    (unsigned long) strlen(m->mailbox), m->mailbox,
-		    (unsigned long) strlen(m->server), m->server);
+		    strlen(m->mailbox), m->mailbox,
+		    strlen(m->server), m->server);
     } else if (send_delete) {
 	/* not found, if needed, send a delete */
-	prot_printf(C->pout, "%s DELETE {%lu+}\r\n%s\r\n",
-		    tag, (unsigned long) strlen(mailbox), mailbox);
+	prot_printf(C->pout, "%s DELETE {%d+}\r\n%s\r\n",
+		    tag, strlen(mailbox), mailbox);
     }
     
     free_mbent(m);
@@ -1644,17 +1644,17 @@
 	    switch (m->t) {
 	    case SET_ACTIVE:
 		prot_printf(C->pout,
-			    "%s MAILBOX {%lu+}\r\n%s {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
+			    "%s MAILBOX {%d+}\r\n%s {%d+}\r\n%s {%d+}\r\n%s\r\n",
 			    C->streaming,
-			    (unsigned long) strlen(m->mailbox), m->mailbox,
-			    (unsigned long) strlen(m->server), m->server,
-			    (unsigned long) strlen(m->acl), m->acl);
+			    strlen(m->mailbox), m->mailbox,
+			    strlen(m->server), m->server,
+			    strlen(m->acl), m->acl);
 		break;
 	    case SET_RESERVE:
-		prot_printf(C->pout, "%s RESERVE {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
+		prot_printf(C->pout, "%s RESERVE {%d+}\r\n%s {%d+}\r\n%s\r\n",
 			    C->streaming,
-			    (unsigned long) strlen(m->mailbox), m->mailbox,
-			    (unsigned long) strlen(m->server), m->server);
+			    strlen(m->mailbox), m->mailbox,
+			    strlen(m->server), m->server);
 		break;
 		
 	    case SET_DELETE:

Modified: trunk/cyrus-imapd-2.2.12/imap/mupdate.h
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/mupdate.h?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/mupdate.h&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/mupdate.h&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/mupdate.h (original)
+++ trunk/cyrus-imapd-2.2.12/imap/mupdate.h Fri Nov 11 17:15:40 2005
@@ -70,8 +70,8 @@
     struct buf tag, cmd, arg1, arg2, arg3;
 
     /* For client side mupdate_find calls */
-    char mailbox_buf[MAX_MAILBOX_NAME+1];
-    char server_buf[MAX_MAILBOX_NAME+1];
+    char mailbox_buf[MAX_MAILBOX_NAME];
+    char server_buf[MAX_MAILBOX_NAME];
     char *acl_buf;
     size_t acl_buf_len;
     struct mupdate_mailboxdata mailboxdata_buf;

Modified: trunk/cyrus-imapd-2.2.12/imap/pop3d.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/pop3d.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/pop3d.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/pop3d.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/pop3d.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/pop3d.c Fri Nov 11 17:15:40 2005
@@ -99,6 +99,8 @@
 extern char *optarg;
 extern int opterr;
 
+
+
 #ifdef HAVE_SSL
 static SSL *tls_conn;
 #endif /* HAVE_SSL */
@@ -494,9 +496,6 @@
 #endif
 
     cyrus_done();
-    cyrus_close_sock(0);
-    cyrus_close_sock(1);
-    cyrus_close_sock(2);
 
     exit(code);
 }
@@ -520,6 +519,41 @@
 }
 
 #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

Modified: trunk/cyrus-imapd-2.2.12/imap/proxyd.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/proxyd.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/proxyd.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/proxyd.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/proxyd.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/proxyd.c Fri Nov 11 17:15:40 2005
@@ -1277,7 +1277,7 @@
 		 char **envp __attribute__((unused)))
 {
     socklen_t salen;
-    char hbuf[NI_MAXHOST+1];
+    char hbuf[NI_MAXHOST];
     struct sockaddr_storage proxyd_localaddr, proxyd_remoteaddr;
     char localip[60], remoteip[60];
     int niflags;
@@ -1443,9 +1443,6 @@
 #endif
 
     cyrus_done();
-    cyrus_close_sock(0);
-    cyrus_close_sock(1);
-    cyrus_close_sock(2);
 
     exit(code);
 }
@@ -2888,8 +2885,7 @@
 	if (!s) r = IMAP_SERVER_UNAVAILABLE;
     }
     if (!r) {
-	prot_printf(s->out, "%s Append {%lu+}\r\n%s ", tag,
-			(unsigned long) strlen(name), name);
+	prot_printf(s->out, "%s Append {%d+}\r\n%s ", tag, strlen(name), name);
 	if (!pipe_command(s, 16384)) {
 	    pipe_until_tag(s, tag, 0);
 	}
@@ -2962,8 +2958,8 @@
 	return;
     }
 
-    prot_printf(backend_current->out, "%s %s {%lu+}\r\n%s\r\n", tag, cmd, 
-		(unsigned long) strlen(name), name);
+    prot_printf(backend_current->out, "%s %s {%d+}\r\n%s\r\n", tag, cmd, 
+		strlen(name), name);
     switch (pipe_including_tag(backend_current, tag, 0)) {
     case PROXY_OK:
 	proc_register("proxyd", proxyd_clienthost, proxyd_userid, mailboxname);
@@ -3193,9 +3189,8 @@
 		    r == 0 ? "[TRYCREATE] " : "", error_message(r));
     } else if (s == backend_current) {
 	/* this is the easy case */
-	prot_printf(backend_current->out, "%s %s %s {%lu+}\r\n%s\r\n",
-		    tag, cmd, sequence, 
-		    (unsigned long) strlen(name), name);
+	prot_printf(backend_current->out, "%s %s %s {%d+}\r\n%s\r\n",
+		    tag, cmd, sequence, strlen(name), name);
 	pipe_including_tag(backend_current, tag, 0);
     } else {
 	char mytag[128];
@@ -3348,8 +3343,7 @@
 	}
 
 	/* start the append */
-	prot_printf(s->out, "%s Append {%lu+}\r\n%s", tag,
-			(unsigned long) strlen(name), name);
+	prot_printf(s->out, "%s Append {%d+}\r\n%s", tag, 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 */;;) {
@@ -3579,8 +3573,8 @@
 
     if (!r) {
 	/* ok, send the create to that server */
-	prot_printf(s->out, "%s CREATE {%lu+}\r\n%s\r\n", 
-		    tag, (unsigned long) strlen(name), name);
+	prot_printf(s->out, "%s CREATE {%d+}\r\n%s\r\n", 
+		    tag, strlen(name), name);
 	res = pipe_including_tag(s, tag, 0);
 	tag = "*";		/* can't send another tagged response */
 	
@@ -3620,8 +3614,8 @@
     }
 
     if (!r) {
-	prot_printf(s->out, "%s DELETE {%lu+}\r\n%s\r\n", 
-		    tag, (unsigned long) strlen(name), name);
+	prot_printf(s->out, "%s DELETE {%d+}\r\n%s\r\n", 
+		    tag, strlen(name), name);
 	res = pipe_including_tag(s, tag, 0);
 	tag = "*";		/* can't send another tagged response */
 
@@ -3722,17 +3716,17 @@
 		/* Cross Server */
 		/* <tag> XFER <name> <dest server> <dest partition> */
 		prot_printf(s->out,
-			    "%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);
+			    "%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);
 	    }
 	    
 	} else {
 	    /* <tag> XFER <name> <dest server> */
-	    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);
+	    prot_printf(s->out, "%s XFER {%d+}\r\n%s {%d+}\r\n%s\r\n", 
+			tag, strlen(oldname), oldname,
+			strlen(partition), partition);
 	}
 	
 	res = pipe_including_tag(s, tag, 0);
@@ -3748,9 +3742,9 @@
 	    /* do MUPDATE create operations for new mailbox */
 	}
 
-	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);
+	prot_printf(s->out, "%s RENAME {%d+}\r\n%s {%d+}\r\n%s\r\n", 
+		    tag, strlen(oldname), oldname,
+		    strlen(newname), newname);
 	res = pipe_including_tag(s, tag, 0);
 	tag = "*";		/* can't send another tagged response */
 	
@@ -3785,8 +3779,8 @@
 
 	if (backend_inbox) {
 	    prot_printf(backend_inbox->out, 
-			"%s Lsub \"\" {%lu+}\r\n%s\r\n",
-			tag, (unsigned long) strlen(pattern), pattern);
+			"%s Lsub \"\" {%d+}\r\n%s\r\n",
+			tag, strlen(pattern), pattern);
 	    pipe_lsub(backend_inbox, tag, 0, "MAILBOX");
 	} else {		/* user doesn't have an INBOX */
 	    /* noop */
@@ -3855,9 +3849,9 @@
 
 	if (backend_inbox) {
 	    prot_printf(backend_inbox->out, 
-			"%s Lsub {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
-			tag, (unsigned long) strlen(reference), reference,
-			(unsigned long) strlen(pattern), pattern);
+			"%s Lsub {%d+}\r\n%s {%d+}\r\n%s\r\n",
+			tag, strlen(reference), reference,
+			strlen(pattern), pattern);
 	    pipe_lsub(backend_inbox, tag, 0, (listopts & LIST_LSUB) ? "LSUB" : "LIST");
 	} else {		/* user doesn't have an INBOX */
 	    /* noop */
@@ -3946,14 +3940,14 @@
 	
 	if (namespace) {
 	    prot_printf(backend_inbox->out, 
-			"%s %s {%lu+}\r\n%s {%lu+}\r\n%s\r\n", 
+			"%s %s {%d+}\r\n%s {%d+}\r\n%s\r\n", 
 			tag, cmd, 
-			(unsigned long) strlen(namespace), namespace,
-			(unsigned long) strlen(name), name);
+			strlen(namespace), namespace,
+			strlen(name), name);
 	} else {
-	    prot_printf(backend_inbox->out, "%s %s {%lu+}\r\n%s\r\n", 
+	    prot_printf(backend_inbox->out, "%s %s {%d+}\r\n%s\r\n", 
 			tag, cmd, 
-			(unsigned long) strlen(name), name);
+			strlen(name), name);
 	}
 	pipe_including_tag(backend_inbox, tag, 0);
     } else {
@@ -4185,15 +4179,15 @@
     } else if (!r) {
 	if (rights) {
 	    prot_printf(s->out, 
-			"%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);
+			"%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);
 	} else {
 	    prot_printf(s->out, 
-			"%s Deleteacl {%lu+}\r\n%s {%lu+}\r\n%s\r\n",
-			tag, (unsigned long) strlen(name), name,
-			(unsigned long) strlen(identifier), identifier);
+			"%s Deleteacl {%d+}\r\n%s {%d+}\r\n%s\r\n",
+			tag, strlen(name), name,
+			strlen(identifier), identifier);
 	}	    
 	res = pipe_including_tag(s, tag, 0);
 	tag = "*";		/* can't send another tagged response */
@@ -4293,8 +4287,8 @@
 	if (!r) s = proxyd_findserver(server);
 
 	if (s) {
-	    prot_printf(s->out, "%s Getquotaroot {%lu+}\r\n%s\r\n",
-			tag, (unsigned long) strlen(name), name);
+	    prot_printf(s->out, "%s Getquotaroot {%d+}\r\n%s\r\n",
+			tag, strlen(name), name);
 	    pipe_including_tag(s, tag, 0);
 	} else {
 	    r = IMAP_SERVER_UNAVAILABLE;
@@ -4520,8 +4514,8 @@
     if (!r) s = proxyd_findserver(server);
     if (!r && !s) r = IMAP_SERVER_UNAVAILABLE;
     if (!r) {
-	prot_printf(s->out, "%s Status {%lu+}\r\n%s ", tag,
-		    (unsigned long) strlen(name), name);
+	prot_printf(s->out, "%s Status {%d+}\r\n%s ", tag,
+		    strlen(name), name);
 	if (!pipe_command(s, 65536)) {
 	    pipe_until_tag(s, tag, 0);
 	}
@@ -4661,7 +4655,7 @@
 
     /* if it's too long, literal it */
     if (*p || len >= 1024) {
-	prot_printf(proxyd_out, "{%lu}\r\n%s", (unsigned long) strlen(s), s);
+	prot_printf(proxyd_out, "{%u}\r\n%s", strlen(s), s);
     } else {
 	prot_printf(proxyd_out, "\"%s\"", s);
     }
@@ -4689,7 +4683,7 @@
 
     /* if it's too long, literal it */
     if (*p || len >= 1024) {
-	prot_printf(proxyd_out, "{%lu}\r\n%s", (unsigned long) strlen(s), s);
+	prot_printf(proxyd_out, "{%u}\r\n%s", strlen(s), s);
     } else {
 	prot_printf(proxyd_out, "\"%s\"", s);
     }

Modified: trunk/cyrus-imapd-2.2.12/imap/quota.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/quota.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/quota.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/quota.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/quota.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/quota.c Fri Nov 11 17:15:40 2005
@@ -196,7 +196,7 @@
 
 void usage(void)
 {
-    fprintf(stderr, "usage: cyrquota [-C <alt_config>] [-d <domain>] [-f] [prefix]...\n");
+    fprintf(stderr, "usage: quota [-C <alt_config>] [-d <domain>] [-f] [prefix]...\n");
     exit(EC_USAGE);
 }    
 

Modified: trunk/cyrus-imapd-2.2.12/imap/reconstruct.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/reconstruct.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/reconstruct.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/reconstruct.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/reconstruct.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/reconstruct.c Fri Nov 11 17:15:40 2005
@@ -345,7 +345,7 @@
 void usage(void)
 {
     fprintf(stderr,
-	    "usage: cyrreconstruct [-C <alt_config>] [-p partition] [-rfx] mailbox...\n");
+	    "usage: reconstruct [-C <alt_config>] [-p partition] [-rfx] mailbox...\n");
     fprintf(stderr, "       reconstruct [-C <alt_config>] -m\n");
     exit(EC_USAGE);
 }    

Modified: trunk/cyrus-imapd-2.2.12/imap/signals.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/signals.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/signals.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/signals.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/signals.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/signals.c Fri Nov 11 17:15:40 2005
@@ -50,7 +50,7 @@
 #include "xmalloc.h"
 #include "exitcodes.h"
 
-static volatile int gotsignal = 0;
+static int gotsignal = 0;
 
 static void sighandler(int sig)
 {

Modified: trunk/cyrus-imapd-2.2.12/imap/spool.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/spool.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/spool.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/spool.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/spool.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/spool.c Fri Nov 11 17:15:40 2005
@@ -140,7 +140,6 @@
     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) {
@@ -267,7 +266,7 @@
 			   form. */
 			r = IMAP_MESSAGE_CONTAINS8BIT;
 			goto ph_error;
-		    } else if (munge8bit) {
+		    } else {
 			/* We have been configured to munge all mail of this
 			   form. */
 			c = 'X';

Modified: trunk/cyrus-imapd-2.2.12/imap/tls.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/tls.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/tls.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/tls.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/tls.c (original)
+++ trunk/cyrus-imapd-2.2.12/imap/tls.c Fri Nov 11 17:15:40 2005
@@ -166,7 +166,7 @@
  * tim - this seems to just be giving logging messages
  */
 
-static void apps_ssl_info_callback(const SSL * s, int where, int ret)
+static void apps_ssl_info_callback(SSL * s, int where, int ret)
 {
     char   *str;
     int     w;
@@ -679,7 +679,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, may be a cert/key mismatch?");
+	syslog(LOG_ERR,"TLS server engine: cannot load cert/key data");
 	return (-1);
     }
     SSL_CTX_set_tmp_rsa_callback(s_ctx, tmp_rsa_cb);
@@ -1098,7 +1098,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, may be a cert/key mismatch?");
+	    syslog(LOG_ERR,"TLS client engine: cannot load cert/key data");
 	    return (-1);
 	}
     }

Modified: trunk/cyrus-imapd-2.2.12/imap/xversion.sh
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imap/xversion.sh?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imap/xversion.sh&r1=172&p2=trunk/cyrus-imapd-2.2.12/imap/xversion.sh&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imap/xversion.sh (original)
+++ trunk/cyrus-imapd-2.2.12/imap/xversion.sh Fri Nov 11 17:15:40 2005
@@ -22,4 +22,4 @@
 	match ($0, pattern) {
 	    printf "\"%s\"\n", substr($0, RSTART, RLENGTH)
 	}' pattern="$DATEPAT $TIMEPAT" | \
-	sort | tail -n 1 >> xversion.h
+	sort | tail -1 >> xversion.h

Modified: trunk/cyrus-imapd-2.2.12/imtest/imtest.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/imtest/imtest.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/imtest/imtest.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/imtest/imtest.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/imtest/imtest.c (original)
+++ trunk/cyrus-imapd-2.2.12/imtest/imtest.c Fri Nov 11 17:15:40 2005
@@ -63,7 +63,6 @@
 
 #include <limits.h>
 #include <unistd.h>
-#include <ctype.h>
 
 #include <netinet/in.h>
 #include <sys/un.h>
@@ -419,7 +418,7 @@
  * tim - this seems to just be giving logging messages
  */
 
-static void apps_ssl_info_callback(const SSL * s, int where, int ret)
+static void apps_ssl_info_callback(SSL * s, int where, int ret)
 {
     char   *str;
     int     w;
@@ -532,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, maybe a cert/key mismatch?\n");
+	    printf("TLS engine: cannot load cert/key data\n");
 	    return IMTEST_FAIL;
 	}
     SSL_CTX_set_tmp_rsa_callback(tls_ctx, tmp_rsa_cb);
@@ -626,13 +625,13 @@
 	return (ret);
     
     if (cmd == (BIO_CB_READ | BIO_CB_RETURN)) {
-	printf("read from %p [%p] (%d bytes => %ld (0x%X))\n",
+	printf("read from %08X [%08lX] (%d bytes => %ld (0x%X))\n",
 	       (unsigned int) bio, (long unsigned int) 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 %p [%p] (%d bytes => %ld (0x%X))\n",
+	printf("write to %08X [%08lX] (%d bytes => %ld (0x%X))\n",
 	       (unsigned int) bio, (long unsigned int) argp,
 	       argi, ret, (unsigned int) ret);
 	tls_dump(argp, (int) ret);
@@ -1226,7 +1225,7 @@
 	
 	/* can't have this and a file for input */
 	sunsock.sun_family = AF_UNIX;
-	strlcpy(sunsock.sun_path, output_socket, sizeof(sunsock.sun_path));
+	strcpy(sunsock.sun_path, output_socket);
 	unlink(output_socket);
 
 	listen_sock = socket(AF_UNIX, SOCK_STREAM, 0);
@@ -1770,8 +1769,7 @@
 {
     int lup;
     
-    prot_printf(pout,"A003 APPEND %s (\\Seen) {%lu}\r\n",mbox,
-		    (unsigned long) size+strlen(HEADERS));
+    prot_printf(pout,"A003 APPEND %s (\\Seen) {%u}\r\n",mbox,size+strlen(HEADERS));
     /* do normal header foo */
     prot_printf(pout,HEADERS);
     

Modified: trunk/cyrus-imapd-2.2.12/installsieve/Makefile.in
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/installsieve/Makefile.in?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/installsieve/Makefile.in&r1=172&p2=trunk/cyrus-imapd-2.2.12/installsieve/Makefile.in&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/installsieve/Makefile.in (original)
+++ trunk/cyrus-imapd-2.2.12/installsieve/Makefile.in Fri Nov 11 17:15:40 2005
@@ -48,7 +48,7 @@
 
 DEFS = @DEFS@
 CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)/../lib @CPPFLAGS@ @SASLFLAGS@
-CFLAGS = @CFLAGS@ @WARNERROR@
+CFLAGS = @CFLAGS@
 LDFLAGS = @LDFLAGS@
 
 INSTALL = @INSTALL@

Modified: trunk/cyrus-imapd-2.2.12/lib/Makefile.in
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/lib/Makefile.in?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/lib/Makefile.in&r1=172&p2=trunk/cyrus-imapd-2.2.12/lib/Makefile.in&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/lib/Makefile.in (original)
+++ trunk/cyrus-imapd-2.2.12/lib/Makefile.in Fri Nov 11 17:15:40 2005
@@ -62,7 +62,7 @@
 LIBS = @LIBS@
 
 MAKEDEPEND_CFLAGS = @CFLAGS@
-CFLAGS = @CFLAGS@ @PERL_CCCDLFLAGS@ @WARNERROR@ -fPIC
+CFLAGS = @CFLAGS@ @PERL_CCCDLFLAGS@
 LDFLAGS = @LDFLAGS@
 
 SHELL = /bin/sh

Modified: trunk/cyrus-imapd-2.2.12/lib/imapoptions
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/lib/imapoptions?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/lib/imapoptions&r1=172&p2=trunk/cyrus-imapd-2.2.12/lib/imapoptions&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/lib/imapoptions (original)
+++ trunk/cyrus-imapd-2.2.12/lib/imapoptions Fri Nov 11 17:15:40 2005
@@ -184,11 +184,7 @@
    mailbox that does not have a parent mailbox. */
 
 { "defaultdomain", NULL, STRING }
-/* 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. */
+/* The default domain for virtual domain support */
 
 { "defaultpartition", "default", STRING }
 /* The partition name used by default for new mailboxes. */
@@ -440,10 +436,7 @@
 /* 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.) 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. */
+   with an "@" in it.). */
 
 { "loginuseacl", 0, SWITCH }
 /* If enabled, any authentication identity which has \fBa\fR rights on a
@@ -464,11 +457,6 @@
 
 { "mboxlist_db", "skiplist", STRINGLIST("flat", "berkeley", "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 }
@@ -682,9 +670,9 @@
 
 { "reject8bit", 0, SWITCH }
 /* If enabled, lmtpd rejects messages with 8-bit characters in the
-   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.) */
+   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.) */
 
 { "rfc2046_strict", 0, SWITCH }
 /* If enabled, imapd will be strict (per RFC 2046) when matching MIME

Modified: trunk/cyrus-imapd-2.2.12/lib/imclient.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/lib/imclient.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/lib/imclient.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/lib/imclient.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/lib/imclient.c (original)
+++ trunk/cyrus-imapd-2.2.12/lib/imclient.c Fri Nov 11 17:15:40 2005
@@ -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, might be a cert/key mismatch]\n");
+	    printf("[ TLS engine: cannot load cert/key data ]\n");
 	    return -1;
 	}
     SSL_CTX_set_tmp_rsa_callback(imclient->tls_ctx, tmp_rsa_cb);

Modified: trunk/cyrus-imapd-2.2.12/lib/lock.h
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/lib/lock.h?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/lib/lock.h&r1=172&p2=trunk/cyrus-imapd-2.2.12/lib/lock.h&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/lib/lock.h (original)
+++ trunk/cyrus-imapd-2.2.12/lib/lock.h Fri Nov 11 17:15:40 2005
@@ -53,8 +53,6 @@
 
 #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: trunk/cyrus-imapd-2.2.12/lib/lock_fcntl.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/lib/lock_fcntl.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/lib/lock_fcntl.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/lib/lock_fcntl.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/lib/lock_fcntl.c (original)
+++ trunk/cyrus-imapd-2.2.12/lib/lock_fcntl.c Fri Nov 11 17:15:40 2005
@@ -47,42 +47,10 @@
 #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',
@@ -97,10 +65,12 @@
  * 'failaction' is provided, it is filled in with a pointer to a fixed
  * string naming the action that failed.
  *
- * We use POSIX semanthics and alarm() to avoid deadlocks
- *
- */
-int lock_reopen (int fd, const char *filename, struct stat *sbuf, const char **failaction)
+ */
+int lock_reopen(fd, filename, sbuf, failaction)
+int fd;
+const char *filename;
+struct stat *sbuf;
+const char **failaction;
 {
     int r;
     struct flock fl;
@@ -109,8 +79,6 @@
 
     if (!sbuf) sbuf = &sbufspare;
 
-    setsigalrm(1);
-    alarm(lock_wait_time);
     for (;;) {
 	fl.l_type= F_WRLCK;
 	fl.l_whence = SEEK_SET;
@@ -118,10 +86,8 @@
 	fl.l_len = 0;
 	r = fcntl(fd, F_SETLKW, &fl);
 	if (r == -1) {
-	    if (errno == EINTR && !lock_gotsigalrm) continue;
+	    if (errno == EINTR) continue;
 	    if (failaction) *failaction = "locking";
-	    alarm(0);
-	    setsigalrm(0);
 	    return -1;
 	}
 
@@ -134,16 +100,10 @@
 	    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) {
-	    alarm(0);
-	    setsigalrm(0);
-	    return 0;
-	}
+	if (sbuf->st_ino == sbuffile.st_ino) return 0;
 
 	newfd = open(filename, O_RDWR);
 	if (newfd == -1) {
@@ -153,15 +113,11 @@
 	    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);
 }
 
 /*
@@ -169,33 +125,22 @@
  * Returns 0 for success, -1 for failure, with errno set to an
  * appropriate error code.
  */
-int lock_blocking(int fd)
-{
-    int r;
-    struct flock fl;
-
-    setsigalrm(1);
-    alarm(lock_wait_time);
+int lock_blocking(fd)
+int fd;
+{
+    int r;
+    struct flock fl;
+
     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) {
-	    alarm(0);
-	    setsigalrm(0);
-	    return 0;
-	}
-	if (errno == EINTR && !lock_gotsigalrm) continue;
-	alarm(0);
-	setsigalrm(0);
+	if (r != -1) return 0;
+	if (errno == EINTR) continue;
 	return -1;
     }
-
-    alarm(0);
-    setsigalrm(0);
-    return 0;
 }
 
 /*
@@ -203,33 +148,22 @@
  * Returns 0 for success, -1 for failure, with errno set to an
  * appropriate error code.
  */
-int lock_shared(int fd)
-{
-    int r;
-    struct flock fl;
-
-    setsigalrm(1);
-    alarm(lock_wait_time);
+int lock_shared(fd)
+int fd;
+{
+    int r;
+    struct flock fl;
+
     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) {
-	    alarm(0);
-	    setsigalrm(0);
-	    return 0;
-	}
-	if (errno == EINTR && !lock_gotsigalrm) continue;
-	alarm(0);
-	setsigalrm(0);
+	if (r != -1) return 0;
+	if (errno == EINTR) continue;
 	return -1;
     }
-
-    alarm(0);
-    setsigalrm(0);
-    return 0;
 }
 
 /*
@@ -237,7 +171,8 @@
  * Returns 0 for success, -1 for failure, with errno set to an
  * appropriate error code.
  */
-int lock_nonblocking(int fd)
+int lock_nonblocking(fd)
+int fd;
 {
     int r;
     struct flock fl;
@@ -252,14 +187,10 @@
 	if (errno == EINTR) continue;
 	return -1;
     }
-
-    return 0;
-}
-
-/*
- * Release any lock on 'fd'
- * Returns 0 for success, -1 for failure, with errno set to an
- * appropriate error code.
+}
+
+/*
+ * Release any lock on 'fd'.  Always returns success.
  */
 int lock_unlock(int fd)
 { 
@@ -275,9 +206,8 @@
         r = fcntl(fd, F_SETLKW, &fl);
         if (r != -1) return 0;
         if (errno == EINTR) continue;
+        /* xxx help! */
         return -1;
     }
-
-    return 0;
-}
-
+}
+

Modified: trunk/cyrus-imapd-2.2.12/lib/lock_flock.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/lib/lock_flock.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/lib/lock_flock.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/lib/lock_flock.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/lib/lock_flock.c (original)
+++ trunk/cyrus-imapd-2.2.12/lib/lock_flock.c Fri Nov 11 17:15:40 2005
@@ -46,8 +46,6 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <errno.h>
-#include <syslog.h>
-#include <signal.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -55,36 +53,6 @@
 #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',
@@ -99,10 +67,12 @@
  * 'failaction' is provided, it is filled in with a pointer to a fixed
  * string naming the action that failed.
  *
- * We use POSIX semanthics and alarm() to avoid deadlocks
- *
  */
-int lock_reopen(int fd, const char *filename, struct stat *sbuf, const char **failaction)
+int lock_reopen(fd, filename, sbuf, failaction)
+int fd;
+const char *filename;
+struct stat *sbuf;
+const char **failaction;
 {
     int r;
     struct stat sbuffile, sbufspare;
@@ -110,15 +80,11 @@
 
     if (!sbuf) sbuf = &sbufspare;
 
-    setsigalrm(1);
-    alarm(lock_wait_time);
     for (;;) {
 	r = flock(fd, LOCK_EX);
 	if (r == -1) {
-	    if (errno == EINTR && !lock_gotsigalrm) continue;
+	    if (errno == EINTR) continue;
 	    if (failaction) *failaction = "locking";
-	    alarm(0);
-	    setsigalrm(0);
 	    return -1;
 	}
 
@@ -127,31 +93,20 @@
 	if (r == -1) {
 	    if (failaction) *failaction = "stating";
 	    flock(fd, LOCK_UN);
-	    alarm(0);
-	    setsigalrm(0);
 	    return -1;
 	}
 
-	if (sbuf->st_ino == sbuffile.st_ino) {
-	    alarm(0);
-	    setsigalrm(0);
-	    return 0;
-	}
+	if (sbuf->st_ino == sbuffile.st_ino) 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;
 }
 
 /*
@@ -159,27 +114,17 @@
  * Returns 0 for success, -1 for failure, with errno set to an
  * appropriate error code.
  */
-int lock_blocking(int fd)
+int lock_blocking(fd)
+int fd;
 {
     int r;
 
-    setsigalrm(1);
-    alarm(lock_wait_time);
     for (;;) {
 	r = flock(fd, LOCK_EX);
-	if (r != -1) {
-	    alarm(0);
-	    setsigalrm(0);
-	    return 0;
-	}
-	if (errno == EINTR && !lock_gotsigalrm) continue;
-	alarm(0);
-	setsigalrm(0);
+	if (r != -1) return 0;
+	if (errno == EINTR) continue;
 	return -1;
     }
-    alarm(0);
-    setsigalrm(0);
-    return 0;
 }
 
 /*
@@ -187,27 +132,17 @@
  * Returns 0 for success, -1 for failure, with errno set to an
  * appropriate error code.
  */
-int lock_shared(int fd)
+int lock_shared(fd)
+int fd;
 {
     int r;
 
-    setsigalrm(1);
-    alarm(lock_wait_time);
     for (;;) {
 	r = flock(fd, LOCK_SH);
-	if (r != -1) {
-	    alarm(0);
-	    setsigalrm(0);
-	    return 0;
-	}
-	if (errno == EINTR && !lock_gotsigalrm) continue;
-	alarm(0);
-	setsigalrm(0);
+	if (r != -1) return 0;
+	if (errno == EINTR) continue;
 	return -1;
     }
-    alarm(0);
-    setsigalrm(0);
-    return 0;
 }
 
 /*
@@ -229,9 +164,7 @@
 }
 
 /*
- * Release any lock on 'fd'.
- * Returns 0 for success, -1 for failure, with errno set to an
- * appropriate error code.
+ * Release any lock on 'fd'.  Always returns success.
  */
 int lock_unlock(int fd)
 {
@@ -241,9 +174,8 @@
         r = flock(fd, LOCK_UN);
         if (r != -1) return 0;
         if (errno == EINTR) continue;
+        /* xxx help! */
         return -1;
     }
-
-    return 0;
 }
 

Modified: trunk/cyrus-imapd-2.2.12/lib/map_stupidshared.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/lib/map_stupidshared.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/lib/map_stupidshared.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/lib/map_stupidshared.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/lib/map_stupidshared.c (original)
+++ trunk/cyrus-imapd-2.2.12/lib/map_stupidshared.c Fri Nov 11 17:15:40 2005
@@ -52,7 +52,6 @@
 #include <sys/stat.h>
 #include <syslog.h>
 
-#include "xmalloc.h"
 #include "map.h"
 #include "exitcodes.h"
 

Modified: trunk/cyrus-imapd-2.2.12/lib/xmalloc.h
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/lib/xmalloc.h?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/lib/xmalloc.h&r1=172&p2=trunk/cyrus-imapd-2.2.12/lib/xmalloc.h&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/lib/xmalloc.h (original)
+++ trunk/cyrus-imapd-2.2.12/lib/xmalloc.h Fri Nov 11 17:15:40 2005
@@ -65,7 +65,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: trunk/cyrus-imapd-2.2.12/man/chk_cyrus.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/chk_cyrus.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/chk_cyrus.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/chk_cyrus.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/chk_cyrus.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/chk_cyrus.8 Fri Nov 11 17:15:40 2005
@@ -83,4 +83,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBmaster(8)\fR

Modified: trunk/cyrus-imapd-2.2.12/man/ctl_cyrusdb.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/ctl_cyrusdb.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/ctl_cyrusdb.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/ctl_cyrusdb.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/ctl_cyrusdb.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/ctl_cyrusdb.8 Fri Nov 11 17:15:40 2005
@@ -94,4 +94,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBmaster(8)\fR

Modified: trunk/cyrus-imapd-2.2.12/man/ctl_deliver.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/ctl_deliver.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/ctl_deliver.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/ctl_deliver.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/ctl_deliver.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/ctl_deliver.8 Fri Nov 11 17:15:40 2005
@@ -78,4 +78,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBmaster(8)\fR

Modified: trunk/cyrus-imapd-2.2.12/man/ctl_mboxlist.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/ctl_mboxlist.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/ctl_mboxlist.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/ctl_mboxlist.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/ctl_mboxlist.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/ctl_mboxlist.8 Fri Nov 11 17:15:40 2005
@@ -138,4 +138,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBmaster(8)\fR

Modified: trunk/cyrus-imapd-2.2.12/man/cyr_expire.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/cyr_expire.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/cyr_expire.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/cyr_expire.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/cyr_expire.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/cyr_expire.8 Fri Nov 11 17:15:40 2005
@@ -90,4 +90,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBmaster(8)\fR

Modified: trunk/cyrus-imapd-2.2.12/man/cyrus.conf.5
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/cyrus.conf.5?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/cyrus.conf.5&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/cyrus.conf.5&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/cyrus.conf.5 (original)
+++ trunk/cyrus-imapd-2.2.12/man/cyrus.conf.5 Fri Nov 11 17:15:40 2005
@@ -44,9 +44,9 @@
 cyrus.conf \- Cyrus configuration file
 .SH DESCRIPTION
 \fB/etc/cyrus.conf\fR 
-is the configuration file for the Cyrus \fBcyrmaster\fR process.  It
+is the configuration file for the Cyrus \fBmaster\fR process.  It
 defines the startup procedures, services and events to be spawned by
-\fBcyrmaster\fR.
+\fBmaster\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 (absolute) path to a UNIX socket, \fIhost\fR is
+where \fIpath\fR is the explicit 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,22 +125,12 @@
 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
@@ -187,6 +177,6 @@
 still have separate access control rules.
 .SH SEE ALSO
 .PP
-\fBcyrmaster(8)\fR, \fBimapd(8)\fR, \fBpop3d(8)\fR, \fBlmtpd(8)\fR,
+\fBmaster(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: trunk/cyrus-imapd-2.2.12/man/deliver.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/deliver.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/deliver.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/deliver.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/deliver.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/deliver.8 Fri Nov 11 17:15:40 2005
@@ -1,5 +1,5 @@
 .\" -*- nroff -*-
-.TH CYRDELIVER 8 "Project Cyrus" CMU
+.TH DELIVER 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
-cyrdeliver \- deliver mail to an IMAP mailbox
+deliver \- deliver mail to an IMAP mailbox
 .SH SYNOPSIS
-.B cyrdeliver
+.B deliver
 [
 .B \-C
 .I config-file
@@ -76,7 +76,7 @@
 .I userid
 ]...
 .br
-.B cyrdeliver
+.B deliver
 [
 .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, cyrdeliver
+Depending on the setting of \fBreject8bit\fR in \fBimapd.conf(5)\fR, deliver
 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: trunk/cyrus-imapd-2.2.12/man/fud.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/fud.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/fud.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/fud.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/fud.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/fud.8 Fri Nov 11 17:15:40 2005
@@ -61,7 +61,7 @@
 ]
 .SH DESCRIPTION
 .B FUD
-is a long lived datagram daemon started from cyrmaster that provides
+is a long lived datagram daemon started from master 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: trunk/cyrus-imapd-2.2.12/man/idled.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/idled.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/idled.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/idled.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/idled.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/idled.8 Fri Nov 11 17:15:40 2005
@@ -56,7 +56,7 @@
 to report the changes to the client.
 .I Idled
 is usually started from
-.I cyrmaster.
+.I master.
 .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, \fBcyrmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBmaster(8)\fR

Modified: trunk/cyrus-imapd-2.2.12/man/imapd.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/imapd.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/imapd.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/imapd.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/imapd.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/imapd.8 Fri Nov 11 17:15:40 2005
@@ -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 cyrmaster (8)
+.IR master (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, \fBcyrmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBmaster(8)\fR

Modified: trunk/cyrus-imapd-2.2.12/man/lmtpd.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/lmtpd.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/lmtpd.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/lmtpd.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/lmtpd.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/lmtpd.8 Fri Nov 11 17:15:40 2005
@@ -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 cyrmaster (8)
+.IR master (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, \fBcyrmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBmaster(8)\fR

Modified: trunk/cyrus-imapd-2.2.12/man/master.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/master.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/master.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/master.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/master.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/master.8 Fri Nov 11 17:15:40 2005
@@ -1,5 +1,5 @@
 .\" -*- nroff -*-
-.TH CYRMASTER 8 "Project Cyrus" CMU
+.TH MASTER 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
-cyrmaster \- master Cyrus process
+master \- master Cyrus process
 .SH SYNOPSIS
-.B cyrmaster
+.B master
 [
 .B \-C
 .I alternate imapd.conf
@@ -79,7 +79,7 @@
 .I snmp agentx socket
 ]
 .SH DESCRIPTION
-.I cyrmaster
+.I Master
 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 cyrmaster (note that this will
-not affect any sub-processes spawned by cyrmaster, you should specify those
+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
 specifically in the respective entries in cyrus.conf).
 .TP
 .BI \-M " alternate cyrus.conf"
-Specifies an alternate cyrus.conf for use by cyrmaster.
+Specifies an alternate cyrus.conf for use by master.
 .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/cyrmaster.pid
+as the pidfile.  If not specified, defaults to /var/run/cyrus-master.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 cyrmaster
+.I master
 reads its configuration information out of the
 .IR cyrus.conf (5)
 file.
 .PP
-.I cyrmaster
+.I Master
 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,18 +146,9 @@
 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/cyrmaster.pid
+.B /etc/cyrus.conf, /etc/imapd.conf, /var/run/cyrus-master.pid
 .SH SEE ALSO
 .PP
 \fBcyrus.conf(5)\fR, \fBimapd.conf(5)\fR, \fBimapd(8)\fR,

Modified: trunk/cyrus-imapd-2.2.12/man/nntpd.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/nntpd.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/nntpd.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/nntpd.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/nntpd.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/nntpd.8 Fri Nov 11 17:15:40 2005
@@ -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 cyrmaster (8)
+.IR master (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, \fBcyrmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBmaster(8)\fR

Modified: trunk/cyrus-imapd-2.2.12/man/notifyd.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/notifyd.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/notifyd.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/notifyd.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/notifyd.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/notifyd.8 Fri Nov 11 17:15:40 2005
@@ -62,7 +62,7 @@
 ]
 .SH DESCRIPTION
 .B Notifyd
-is a daemon started from cyrmaster(8) that handles notification requests on
+is a daemon started from master(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, \fBcyrmaster(8)\fR, \fBlmtpd(8)\fR
+\fBimapd.conf(5)\fR, \fBcyrus.conf\fR, \fBmaster(8)\fR, \fBlmtpd(8)\fR

Modified: trunk/cyrus-imapd-2.2.12/man/pop3d.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/pop3d.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/pop3d.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/pop3d.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/pop3d.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/pop3d.8 Fri Nov 11 17:15:40 2005
@@ -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 cyrmaster (8)
+.IR master (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, \fBcyrmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBmaster(8)\fR

Modified: trunk/cyrus-imapd-2.2.12/man/quota.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/quota.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/quota.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/quota.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/quota.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/quota.8 Fri Nov 11 17:15:40 2005
@@ -1,5 +1,5 @@
 .\" -*- nroff -*-
-.TH CYRQUOTA 8 "Project Cyrus" CMU
+.TH QUOTA 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
-cyrquota \- report and optionally fix quota usage
+quota \- report and optionally fix quota usage
 .SH SYNOPSIS
-.B cyrquota
+.B quota
 [
 .B \-C
 .I config-file
@@ -59,12 +59,12 @@
 .IR mailbox-prefix ...
 ]
 .SH DESCRIPTION
-.I cyrquota
+.I Quota
 generates a report listing quota roots, giving their limits and usage.
 If the
 .I \-f
 option is given, 
-.I cyrquota
+.I quota
 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 cyrquota
+.I quota
 with both the 
 .I \-f
 option and
 .I mailbox-prefix
 arguments is not recommended.
 .PP
-.I cyrquota
+.I Quota
 reads its configuration options out of the
 .IR imapd.conf (5)
 file unless specified otherwise by \fB-C\fR.

Modified: trunk/cyrus-imapd-2.2.12/man/reconstruct.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/reconstruct.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/reconstruct.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/reconstruct.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/reconstruct.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/reconstruct.8 Fri Nov 11 17:15:40 2005
@@ -1,5 +1,5 @@
 .\" -*- nroff -*-
-.TH CYRRECONSTRUCT 8 "Project Cyrus" CMU
+.TH RECONSTRUCT 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
-cyrreconstruct \- reconstruct mailboxes
+reconstruct \- reconstruct mailboxes
 .SH SYNOPSIS
-.B cyrreconstruct
+.B reconstruct
 [
 .B \-C
 .I config-file
@@ -63,14 +63,14 @@
 ]
 .IR mailbox ...
 .br
-.B cyrreconstruct
+.B reconstruct
 [
 .B \-C
 .I config-file
 ]
 .B \-m
 .SH DESCRIPTION
-.I cyrreconstruct
+.I Reconstruct
 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 cyrreconstruct
+.I Reconstruct
 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 cyrreconstruct
+.I reconstruct
 attempts to preserve includes the flag names, flag state, and
 internaldate.
-.I cyrreconstruct
+.I Reconstruct
 derives all other information from the message files.
 .PP
-.I cyrreconstruct
+.I Reconstruct
 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 cyrreconstruct
+.I Reconstruct
 does not adjust the quota usage recorded in any quota
 root files.  After running
-.IR cyrreconstruct ,
+.IR reconstruct ,
 it is advisable to run
-.IR cyrquota (8)
+.IR quota (8)
 with the
 .I \-f
 switch in order to fix the quota root files.

Modified: trunk/cyrus-imapd-2.2.12/man/smmapd.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/smmapd.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/smmapd.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/smmapd.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/smmapd.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/smmapd.8 Fri Nov 11 17:15:40 2005
@@ -67,7 +67,7 @@
 It accepts commands on its standard input and responds on its standard
 output.
 It MUST be invoked by
-.IR cyrmaster (8)
+.IR master (8)
 with those descriptors attached to a remote client connection.
 .PP
 .B SMMAPD

Modified: trunk/cyrus-imapd-2.2.12/man/timsieved.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/timsieved.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/timsieved.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/timsieved.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/timsieved.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/timsieved.8 Fri Nov 11 17:15:40 2005
@@ -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 cyrmaster (8)
+.IR master (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, \fBcyrmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBmaster(8)\fR

Modified: trunk/cyrus-imapd-2.2.12/man/tls_prune.8
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/man/tls_prune.8?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/man/tls_prune.8&r1=172&p2=trunk/cyrus-imapd-2.2.12/man/tls_prune.8&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/man/tls_prune.8 (original)
+++ trunk/cyrus-imapd-2.2.12/man/tls_prune.8 Fri Nov 11 17:15:40 2005
@@ -67,4 +67,4 @@
 .B /etc/imapd.conf
 .SH SEE ALSO
 .PP
-\fBimapd.conf(5)\fR, \fBcyrmaster(8)\fR
+\fBimapd.conf(5)\fR, \fBmaster(8)\fR

Modified: trunk/cyrus-imapd-2.2.12/master/CYRUS-MASTER.mib
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/master/CYRUS-MASTER.mib?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/master/CYRUS-MASTER.mib&r1=172&p2=trunk/cyrus-imapd-2.2.12/master/CYRUS-MASTER.mib&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/master/CYRUS-MASTER.mib (original)
+++ trunk/cyrus-imapd-2.2.12/master/CYRUS-MASTER.mib Fri Nov 11 17:15:40 2005
@@ -1,15 +1,12 @@
 CYRUS-MASTER-MIB DEFINITIONS ::= BEGIN
 
 IMPORTS
-    MODULE-IDENTITY, OBJECT-TYPE, Counter32, enterprises
+    MODULE-IDENTITY, OBJECT-TYPE, Counter32
         FROM SNMPv2-SMI
     DisplayString
-        FROM SNMPv2-TC;
---    cmuCyrus
---        FROM CMU-MIB;
-
-cmuMIB         OBJECT IDENTIFIER ::= { enterprises 3 }
-cmuCyrus       OBJECT IDENTIFIER ::= { cmuMIB 6 }
+        FROM SNMPv2-TC
+    cmuCyrus
+        FROM CMU-MIB;
 
 cyrusMasterMIB MODULE-IDENTITY
     LAST-UPDATED "0010312300Z"		-- 2000 Oct 31

Modified: trunk/cyrus-imapd-2.2.12/master/Makefile.in
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/master/Makefile.in?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/master/Makefile.in&r1=172&p2=trunk/cyrus-imapd-2.2.12/master/Makefile.in&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/master/Makefile.in (original)
+++ trunk/cyrus-imapd-2.2.12/master/Makefile.in Fri Nov 11 17:15:40 2005
@@ -57,7 +57,7 @@
 CPPFLAGS = -I.. -I$(srcdir)/../lib -I$(srcdir)/../imap @CPPFLAGS@ @COM_ERR_CPPFLAGS@
 DEPLIBS = @DEPLIBS@
 
-CFLAGS = @CFLAGS@ @WARNERROR@
+CFLAGS = @CFLAGS@
 LDFLAGS = @LDFLAGS@ @COM_ERR_LDFLAGS@
 LIBS = ../lib/libcyrus_min.a @LIB_UCDSNMP@ @LIBS@ @COM_ERR_LIBS@
 

Modified: trunk/cyrus-imapd-2.2.12/master/master.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/master/master.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/master/master.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/master/master.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/master/master.c (original)
+++ trunk/cyrus-imapd-2.2.12/master/master.c Fri Nov 11 17:15:40 2005
@@ -162,8 +162,6 @@
 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 */
@@ -190,7 +188,7 @@
     struct passwd *p;
     int newuid, newgid;
     int result;
-    static uid_t uid = 0;
+    static int uid = 0;
 
     if (uid) return setuid(uid);
 
@@ -224,12 +222,11 @@
     return result;
 }
 
-void get_prog(char *path, unsigned int size, char *const *cmd)
+void get_prog(char *path, unsigned size, char *const *cmd)
 {
     if (cmd[0][0] == '/') {
 	/* master lacks strlcpy, due to no libcyrus */
 	snprintf(path, size, "%s", cmd[0]);
-	path[size-1] = '\0';
     }
     else snprintf(path, size, "%s/%s", SERVICE_PATH, cmd[0]);
 }
@@ -914,7 +911,7 @@
 		}
 	    }
 	    c->service_state = SERVICE_STATE_DEAD;
-	    c->janitor_deadline = time(NULL) + child_mourning_time;
+	    c->janitor_deadline = time(NULL) + 2;
 	} else {
 	    /* weird. Are we multithreaded now? we don't know this child */
 	    syslog(LOG_WARNING,
@@ -923,7 +920,7 @@
 	    c = get_centry();
 	    c->pid = pid;
 	    c->service_state = SERVICE_STATE_DEAD;
-	    c->janitor_deadline = time(NULL) + child_mourning_time;
+	    c->janitor_deadline = time(NULL) + 2;
 	    c->si = SERVICE_NONE;
 	    c->next = ctable[pid % child_table_size];
 	    ctable[pid % child_table_size] = c;
@@ -1076,36 +1073,6 @@
     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) 
@@ -1421,9 +1388,8 @@
 	snprintf(buf, sizeof(buf),
 		 "cannot find executable for service '%s'", name);
 	
-	/* if it is not, we just skip it */
-	syslog(LOG_WARNING, "WARNING: %s -- ignored", buf);
-	return;
+	/* if it is not, we're misconfigured, die. */
+	fatal(buf, EX_CONFIG);
     }
 
     Services[i].maxforkrate = maxforkrate;
@@ -1435,7 +1401,7 @@
 	Services[i].desired_workers = prefork;
 	Services[i].babysit = babysit;
 	Services[i].max_workers = atoi(max);
-	if (Services[i].max_workers < 0) {
+	if (Services[i].max_workers == -1) {
 	    Services[i].max_workers = INT_MAX;
 	}
     } else {
@@ -1443,7 +1409,6 @@
 	if (prefork > 1) prefork = 1;
 	Services[i].desired_workers = prefork;
 	Services[i].max_workers = 1;
-	Services[i].babysit = 0;
     }
     free(max);
  
@@ -1483,7 +1448,7 @@
     if (!cmd) {
 	char buf[256];
 	snprintf(buf, sizeof(buf),
-		 "unable to find command for event '%s'", name);
+		 "unable to find command or port for event '%s'", name);
 
 	if (ignore_err) {
 	    syslog(LOG_WARNING, "WARNING: %s -- ignored", buf);
@@ -1537,7 +1502,7 @@
 
     rl.rlim_cur = x;
     rl.rlim_max = x;
-    if (setrlimit(RLIMIT_NUMFDS, &rl) < 0 && x != RLIM_INFINITY) {
+    if (setrlimit(RLIMIT_NUMFDS, &rl) < 0) {
 	syslog(LOG_ERR, "setrlimit: Unable to set file descriptors limit to %ld: %m", x);
 
 #ifdef HAVE_GETRLIMIT
@@ -1552,9 +1517,11 @@
     }
 
 
-    if (verbose > 1 && getrlimit(RLIMIT_NUMFDS, &rl) >=0)
-	syslog(LOG_DEBUG, "set maximum file descriptors to %ld/%ld",
-		rl.rlim_cur, rl.rlim_max);
+    if (verbose > 1) {
+	r = getrlimit(RLIMIT_NUMFDS, &rl);
+	syslog(LOG_DEBUG, "set maximum file descriptors to %ld/%ld", rl.rlim_cur,
+	       rl.rlim_max);
+    }
 #else
     }
 #endif /* HAVE_GETRLIMIT */
@@ -1573,10 +1540,7 @@
 
     /* disable all services -
        they will be re-enabled if they appear in config file */
-    for (i = 0; i < nservices; i++) {
-	if (Services[i].exec) free((void*)Services[i].exec);
-	Services[i].exec = NULL;
-    }
+    for (i = 0; i < nservices; i++) Services[i].exec = NULL;
 
     /* read services */
     masterconf_getsection("SERVICES", &add_service, (void*) 1);
@@ -1591,19 +1555,13 @@
 		       Services[i].stat[0], Services[i].stat[1]);
 
 	    /* Only free the service info on the primary */
-	    if (Services[i].associate == 0) {
-		free(Services[i].name);
+	    if(Services[i].associate == 0) {
 		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++ ) {
@@ -1686,9 +1644,9 @@
     p = getenv("CYRUS_VERBOSE");
     if (p) verbose = atoi(p) + 1;
 #ifdef HAVE_NETSNMP
-    while ((opt = getopt(argc, argv, "C:M:p:l:DdjJ:P:x:")) != EOF) {
+    while ((opt = getopt(argc, argv, "C:M:p:l:Ddj:P:x:")) != EOF) {
 #else
-    while ((opt = getopt(argc, argv, "C:M:p:l:DdjJ:")) != EOF) {
+    while ((opt = getopt(argc, argv, "C:M:p:l:Ddj:")) != EOF) {
 #endif
 	switch (opt) {
 	case 'C': /* alt imapd.conf file */
@@ -1721,15 +1679,8 @@
 	    /* Janitor frequency */
 	    janitor_frequency = atoi(optarg);
 	    if(janitor_frequency < 1)
-		fatal("The janitor frequency must be at least once per second", EX_CONFIG);
+		fatal("The janitor period must be at least 1 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);
@@ -1886,7 +1837,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) {
@@ -2105,19 +2056,13 @@
 	    int j;
 
 	    if (FD_ISSET(x, &rfds)) {
-		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);
+		r = read(x, &msg, sizeof(msg));
+		if (r != sizeof(msg)) {
+		    syslog(LOG_ERR, "got incorrectly sized response from child: %x", i);
 		    continue;
 		}
-		if (r < 0) {
-		    syslog(LOG_ERR,
-			"error while receiving message from child %x: %m", i);
-		    continue;
-		}
+		
+		process_msg(i, &msg);
 	    }
 
 	    if (Services[i].exec &&

Modified: trunk/cyrus-imapd-2.2.12/master/master.h
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/master/master.h?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/master/master.h&r1=172&p2=trunk/cyrus-imapd-2.2.12/master/master.h&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/master/master.h (original)
+++ trunk/cyrus-imapd-2.2.12/master/master.h Fri Nov 11 17:15:40 2005
@@ -43,7 +43,6 @@
 extern struct service *Services;
 extern int allocservices;
 extern int nservices;
-void sighandler_setup(void);
 
 /*
  * Description of multiple address family support from

Modified: trunk/cyrus-imapd-2.2.12/master/masterconf.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/master/masterconf.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/master/masterconf.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/master/masterconf.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/master/masterconf.c (original)
+++ trunk/cyrus-imapd-2.2.12/master/masterconf.c Fri Nov 11 17:15:40 2005
@@ -133,7 +133,7 @@
 	} else {
 	    /* one word */
 	    for (i = 0; i < 255; i++) {
-		if ((!*p) || (isspace((int) *p))) break;
+		if (isspace((int) *p)) break;
 		v[i] = *p++;
 	    }
 	}
@@ -150,13 +150,8 @@
     const char *val = masterconf_getstring(e, key, NULL);
 
     if (!val) 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;
-    }
-
+    if (!isdigit((int) *val) && 
+	(*val != '-' || !isdigit((int) val[1]))) return def;
     return atoi(val);
 }
 
@@ -174,10 +169,6 @@
 	     (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: trunk/cyrus-imapd-2.2.12/master/service.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/master/service.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/master/service.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/master/service.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/master/service.c (original)
+++ trunk/cyrus-imapd-2.2.12/master/service.c Fri Nov 11 17:15:40 2005
@@ -186,7 +186,7 @@
 	       !signals_poll())
 	    /* noop */;
 	
-	if (rc < 0 && signals_poll) {
+	if (rc < 0 && signals_poll()) {
 	    if (MESSAGE_MASTER_ON_EXIT) 
 		notify_master(STATUS_FD, MASTER_SERVICE_UNAVAILABLE);
 	    service_abort(0);

Modified: trunk/cyrus-imapd-2.2.12/notifyd/Makefile.in
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/notifyd/Makefile.in?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/notifyd/Makefile.in&r1=172&p2=trunk/cyrus-imapd-2.2.12/notifyd/Makefile.in&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/notifyd/Makefile.in (original)
+++ trunk/cyrus-imapd-2.2.12/notifyd/Makefile.in Fri Nov 11 17:15:40 2005
@@ -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@ @WARNERROR@
+CFLAGS = @CFLAGS@
 LDFLAGS = @LDFLAGS@
 
 prefix = @prefix@

Modified: trunk/cyrus-imapd-2.2.12/notifyd/notify_log.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/notifyd/notify_log.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/notifyd/notify_log.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/notifyd/notify_log.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/notifyd/notify_log.c (original)
+++ trunk/cyrus-imapd-2.2.12/notifyd/notify_log.c Fri Nov 11 17:15:40 2005
@@ -69,6 +69,9 @@
 	strcat(opt_str, ")");
     }
 
+/*  Not needed, we opened the log file in cyrus_init */
+/*    openlog("notifyd", LOG_PID, SYSLOG_FACILITY); */
+
     syslog(LOG_INFO, "%s, %s, %s, %s, %s \"%s\"",
 	   class, priority, user, mailbox, opt_str, message);
     closelog();

Modified: trunk/cyrus-imapd-2.2.12/notifyd/notifyd.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/notifyd/notifyd.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/notifyd/notifyd.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/notifyd/notifyd.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/notifyd/notifyd.c (original)
+++ trunk/cyrus-imapd-2.2.12/notifyd/notifyd.c Fri Nov 11 17:15:40 2005
@@ -143,7 +143,7 @@
 	if (cp) nopt = strtol(cp, NULL, 10);
 	if (nopt < 0 || errno == ERANGE) cp = NULL;
 
-	if (cp && (nopt > 0) &&
+	if (cp && nopt &&
 	    !(options = (char**) xrealloc(options, nopt * sizeof(char*)))) {
 	    fatal("xmalloc(): can't allocate options", EC_OSERR);
 	}

Modified: trunk/cyrus-imapd-2.2.12/perl/Makefile.in
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/perl/Makefile.in?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/perl/Makefile.in&r1=172&p2=trunk/cyrus-imapd-2.2.12/perl/Makefile.in&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/perl/Makefile.in (original)
+++ trunk/cyrus-imapd-2.2.12/perl/Makefile.in Fri Nov 11 17:15:40 2005
@@ -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 INSTALLDIRS=vendor; \
+			     $(PERL) Makefile.PL PREFIX=$(prefix); \
 			fi; \
-			$(MAKE) $(MFLAGS) LD_RUN_PATH= DESTDIR=$(DESTDIR) all) || exit 1; \
+			$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) all) || exit 1; \
 	done
 
 install::

Modified: trunk/cyrus-imapd-2.2.12/perl/imap/IMAP/Shell.pm
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/perl/imap/IMAP/Shell.pm?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/perl/imap/IMAP/Shell.pm&r1=172&p2=trunk/cyrus-imapd-2.2.12/perl/imap/IMAP/Shell.pm&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/perl/imap/IMAP/Shell.pm (original)
+++ trunk/cyrus-imapd-2.2.12/perl/imap/IMAP/Shell.pm Fri Nov 11 17:15:40 2005
@@ -429,7 +429,7 @@
 # programs, as opposed to things expected from within a program.)
 sub shell {
   my ($server, $port, $authz, $auth, $systemrc, $userrc, $dorc, $mech, $pw) =
-    ('', 143, undef, $ENV{USER} || $ENV{LOGNAME}, '/etc/cyradmrc.pl',
+    ('', 143, undef, $ENV{USER} || $ENV{LOGNAME}, '/usr/local/etc/cyradmrc.pl',
      "$ENV{HOME}/.cyradmrc.pl", 1, undef, undef);
   GetOptions('user|u=s' => \$auth,
 	     'authz|z=s' => \$authz,
@@ -459,7 +459,7 @@
 			  -rock => \$cyradm});
     $cyradm->authenticate(-authz => $authz, -user => $auth,
 			  -mechanism => $mech, -password => $pw)
-      or die "cyradm: cannot authenticate to server" . (defined($mech)?" with $mech":"") . " as $auth\n";
+      or die "cyradm: cannot authenticate to server with $mech as $auth\n";
   }
   my $fstk = [*STDIN, *STDOUT, *STDERR];
   if ($dorc && $systemrc ne '' && -f $systemrc) {

Modified: trunk/cyrus-imapd-2.2.12/perl/sieve/Makefile.in
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/perl/sieve/Makefile.in?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/perl/sieve/Makefile.in&r1=172&p2=trunk/cyrus-imapd-2.2.12/perl/sieve/Makefile.in&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/perl/sieve/Makefile.in (original)
+++ trunk/cyrus-imapd-2.2.12/perl/sieve/Makefile.in Fri Nov 11 17:15:40 2005
@@ -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 INSTALLDIRS=vendor; \
+			     $(PERL) Makefile.PL PREFIX=$(prefix); \
 			fi; \
-			$(MAKE) $(MFLAGS) LD_RUN_PATH= DESTDIR=$(DESTDIR) all) || exit 1; \
+			$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) all) || exit 1; \
 	done
 
 install::

Modified: trunk/cyrus-imapd-2.2.12/perl/sieve/lib/Makefile.in
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/perl/sieve/lib/Makefile.in?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/perl/sieve/lib/Makefile.in&r1=172&p2=trunk/cyrus-imapd-2.2.12/perl/sieve/lib/Makefile.in&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/perl/sieve/lib/Makefile.in (original)
+++ trunk/cyrus-imapd-2.2.12/perl/sieve/lib/Makefile.in Fri Nov 11 17:15:40 2005
@@ -57,7 +57,7 @@
 DEPLIBS = ../../../lib/libcyrus.a ../../../lib/libcyrus_min.a @DEPLIBS@
 
 MAKEDEPEND_CFLAGS = @CFLAGS@
-CFLAGS = @CFLAGS@ @PERL_CCCDLFLAGS@ -fPIC
+CFLAGS = @CFLAGS@ @PERL_CCCDLFLAGS@
 LDFLAGS = @LDFLAGS@
 
 SHELL = /bin/sh

Modified: trunk/cyrus-imapd-2.2.12/perl/sieve/lib/request.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/perl/sieve/lib/request.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/perl/sieve/lib/request.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/perl/sieve/lib/request.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/perl/sieve/lib/request.c (original)
+++ trunk/cyrus-imapd-2.2.12/perl/sieve/lib/request.c Fri Nov 11 17:15:40 2005
@@ -560,6 +560,7 @@
 	      char **refer_to, char **errstrp)
 {
   int res;
+  mystring_t *str=NULL;
   mystring_t *errstr=NULL;
   lexstate_t state;
   int ret = 0;

Modified: trunk/cyrus-imapd-2.2.12/ptclient/ptexpire.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/ptclient/ptexpire.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/ptclient/ptexpire.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/ptclient/ptexpire.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/ptclient/ptexpire.c (original)
+++ trunk/cyrus-imapd-2.2.12/ptclient/ptexpire.c Fri Nov 11 17:15:40 2005
@@ -114,7 +114,7 @@
 
     if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
     
-    openlog("cyrus/ptexpire", LOG_PID, SYSLOG_FACILITY);
+    openlog("ptexpire", LOG_PID, SYSLOG_FACILITY);
 
     while ((opt = getopt(argc, argv, "C:E:")) != EOF) {
 	switch (opt) {

Modified: trunk/cyrus-imapd-2.2.12/ptclient/test.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/ptclient/test.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/ptclient/test.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/ptclient/test.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/ptclient/test.c (original)
+++ trunk/cyrus-imapd-2.2.12/ptclient/test.c Fri Nov 11 17:15:40 2005
@@ -57,7 +57,7 @@
     cacheid=cache;
   } else
     cacheid=NULL;
-  openlog("cyrus/pttest", LOG_PID, SYSLOG_FACILITY);  
+  openlog("pttest", LOG_PID, SYSLOG_FACILITY);  
   
   if (!auth_setid(argv[1],cacheid))
     printf ("Auth_memberof(%s,%s) is %d\n", argv[1], argv[2],

Modified: trunk/cyrus-imapd-2.2.12/ptclient/test2.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/ptclient/test2.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/ptclient/test2.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/ptclient/test2.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/ptclient/test2.c (original)
+++ trunk/cyrus-imapd-2.2.12/ptclient/test2.c Fri Nov 11 17:15:40 2005
@@ -46,7 +46,7 @@
 
 int main(void) {
   char cacheid[16]="4224423";
-  openlog("cyrus/testr", LOG_PID, SYSLOG_FACILITY);
+  openlog("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: trunk/cyrus-imapd-2.2.12/sieve/Makefile.in
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/sieve/Makefile.in?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/sieve/Makefile.in&r1=172&p2=trunk/cyrus-imapd-2.2.12/sieve/Makefile.in&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/sieve/Makefile.in (original)
+++ trunk/cyrus-imapd-2.2.12/sieve/Makefile.in Fri Nov 11 17:15:40 2005
@@ -40,7 +40,7 @@
 DEFS = @DEFS@
 CPPFLAGS = -I.. -I$(srcdir)/../lib @COM_ERR_CPPFLAGS@ @CPPFLAGS@ @SASLFLAGS@
 MAKEDEPEND_CFLAGS = @CFLAGS@
-CFLAGS = @CFLAGS@ @PERL_CCCDLFLAGS@ -fPIC
+CFLAGS = @CFLAGS@ @PERL_CCCDLFLAGS@
 LDFLAGS = @LDFLAGS@
 
 MAKEDEPEND = @MAKEDEPEND@
@@ -51,7 +51,6 @@
 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
@@ -115,7 +114,7 @@
 	$(COMPILE_ET) $(srcdir)/sieve_err.et
 
 clean:
-	rm -f test *~ *.o *.a Makefile.bak makedepend.log $(BINARIES)
+	rm -f test *~ *.o *.a Makefile.bak makedepend.log
 
 distclean: clean
 	rm -f Makefile

Modified: trunk/cyrus-imapd-2.2.12/sieve/md5.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/sieve/md5.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/sieve/md5.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/sieve/md5.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/sieve/md5.c (original)
+++ trunk/cyrus-imapd-2.2.12/sieve/md5.c Fri Nov 11 17:15:40 2005
@@ -31,7 +31,7 @@
 
 #include "md5global.h"
 #include "md5.h"
-#include "sasl/hmac-md5.h"
+#include "hmac-md5.h"
 
 /* Constants for MD5Transform routine.
 */

Modified: trunk/cyrus-imapd-2.2.12/timsieved/Makefile.in
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/timsieved/Makefile.in?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/timsieved/Makefile.in&r1=172&p2=trunk/cyrus-imapd-2.2.12/timsieved/Makefile.in&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/timsieved/Makefile.in (original)
+++ trunk/cyrus-imapd-2.2.12/timsieved/Makefile.in Fri Nov 11 17:15:40 2005
@@ -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@ @WARNERROR@
+CFLAGS = @CFLAGS@
 LDFLAGS = @LDFLAGS@
 
 prefix = @prefix@

Modified: trunk/cyrus-imapd-2.2.12/timsieved/actions.c
URL: https://mail.incase.de/viewcvs?root=cyrus22/trunk/cyrus-imapd-2.2.12/timsieved/actions.c?view=diff&rev=173&p1=trunk/cyrus-imapd-2.2.12/timsieved/actions.c&r1=172&p2=trunk/cyrus-imapd-2.2.12/timsieved/actions.c&r2=173
==============================================================================
--- trunk/cyrus-imapd-2.2.12/timsieved/actions.c (original)
+++ trunk/cyrus-imapd-2.2.12/timsieved/actions.c Fri Nov 11 17:15:40 2005
@@ -353,8 +353,7 @@
 
   if (result != TIMSIEVE_OK) {
       if (errstr && *errstr) { 
-	  prot_printf(conn, "NO {%lu}\r\n%s\r\n",
-			  (unsigned long) strlen(errstr), errstr);
+	  prot_printf(conn, "NO {%d}\r\n%s\r\n", strlen(errstr), errstr);
 	  free(errstr);
       } else {
 	  if (errstr) free(errstr);




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