--- ./imap/imapd.c Tue Jun 24 23:33:59 2003 +++ ../cyrus-imapd-2.1.14/./imap/imapd.c Thu Aug 14 15:10:38 2003 @@ -5839,7 +5839,7 @@ { int i=0, j=0; char tagbuf[128]; - char c; + int c; struct buf tag, cmd, tmp, user; int r = 0; @@ -5954,7 +5954,7 @@ char *mailbox, char *acl_in) { int r = 0; - char c; + int c; char tag[128]; int tagnum = 1; char *rights, *nextid; --- ./imap/mbpath.c Thu Feb 13 15:15:28 2003 +++ ../cyrus-imapd-2.1.14/./imap/mbpath.c Thu Aug 14 15:10:38 2003 @@ -96,7 +96,7 @@ { char *path; int rc, i, quiet = 0, stop_on_error=0; - char opt; + int opt; char *alt_config = NULL; while ((opt = getopt(argc, argv, "C:qs")) != EOF) { --- ./imap/ipurge.c Tue Apr 22 13:39:41 2003 +++ ../cyrus-imapd-2.1.14/./imap/ipurge.c Thu Aug 14 15:10:38 2003 @@ -105,7 +105,7 @@ void print_stats(mbox_stats_t *stats); int main (int argc, char *argv[]) { - char option; + int option; char buf[MAX_MAILBOX_PATH+1]; char *alt_config = NULL; int r; --- ./imap/lmtpstats.h Wed Jul 2 12:55:07 2003 +++ ../cyrus-imapd-2.1.14/./imap/lmtpstats.h Thu Aug 14 15:10:38 2003 @@ -40,7 +40,7 @@ #define snmp_increment(a, b) -#define snmp_increment_args(...) +#define snmp_increment_args(a, b, c,d,e) #define snmp_set(a, b) --- ./imap/pushstats.h Wed Jul 2 12:55:07 2003 +++ ../cyrus-imapd-2.1.14/./imap/pushstats.h Thu Aug 14 15:10:38 2003 @@ -36,7 +36,7 @@ #define snmp_increment(a, b) -#define snmp_increment_args(...) +#define snmp_increment_args(a, b, c,d,e) #define snmp_set(a, b) --- ./perl/imap/cyradm.sh Thu Sep 12 11:36:21 2002 +++ ../cyrus-imapd-2.1.14/./perl/imap/cyradm.sh Thu Aug 14 15:10:38 2003 @@ -41,8 +41,8 @@ # # $Id: cyradm.sh,v 1.11 2002/09/12 15:36:21 rjs3 Exp $ case "x$BASH_VERSION" in -x) exec perl -MCyrus::IMAP::Shell -e shell -- ${1+"$@"} ;; -*) exec perl -MCyrus::IMAP::Shell -e shell -- "$@" ;; +x) exec /usr/bin/perl5 -MCyrus::IMAP::Shell -e shell -- ${1+"$@"} ;; +*) exec /usr/bin/perl5 -MCyrus::IMAP::Shell -e shell -- "$@" ;; esac echo "$0: how did I get here?" >&2 exit 1 --- ./perl/sieve/lib/mystring.c Thu Feb 13 15:15:53 2003 +++ ../cyrus-imapd-2.1.14/./perl/sieve/lib/mystring.c Thu Aug 14 15:10:38 2003 @@ -187,7 +187,7 @@ } */ -int safe_to_use_quoted(char *str, int len) +int safe_to_use_quoted(signed char *str, int len) { char *end=str+len; --- ./perl/sieve/lib/mystring.h Thu Feb 13 15:15:53 2003 +++ ../cyrus-imapd-2.1.14/./perl/sieve/lib/mystring.h Thu Aug 14 15:10:38 2003 @@ -76,7 +76,7 @@ #define string_DATAPTR(s) (s ? (((char *) s)+sizeof(mystring_t)) : 0) -int safe_to_use_quoted(char *str, int len); +int safe_to_use_quoted(signed char *str, int len); #endif /* INCLUDED_MYSTRING_H */ --- ./perl/sieve/Makefile.in Mon Jul 22 12:16:09 2002 +++ ../cyrus-imapd-2.1.14/./perl/sieve/Makefile.in Thu Aug 14 15:10:38 2003 @@ -72,7 +72,7 @@ PERL=@PERL@ all:: - @for d in $(SUBDIRS); \ + for d in $(SUBDIRS); \ do \ (cd $$d; echo "### Making" all "in" `pwd`; \ if [ -f Makefile.PL ]; then \ --- ./perl/sieve/scripts/installsieve.pl Sat May 25 15:57:52 2002 +++ ../cyrus-imapd-2.1.14/./perl/sieve/scripts/installsieve.pl Thu Aug 14 15:10:38 2003 @@ -1,5 +1,5 @@ #! /bin/sh -exec perl -x -S $0 ${1+"$@"} # -*-perl-*- +exec /usr/bin/perl5 -x -S $0 ${1+"$@"} # -*-perl-*- #!perl -w # # Copyright (c) 2000 Carnegie Mellon University. All rights reserved. --- ./perl/sieve/scripts/sieveshell.pl Mon Dec 2 14:45:11 2002 +++ ../cyrus-imapd-2.1.14/./perl/sieve/scripts/sieveshell.pl Thu Aug 14 15:10:38 2003 @@ -1,5 +1,5 @@ #! /bin/sh -exec perl -x -S $0 ${1+"$@"} # -*-perl-*- +exec /usr/bin/perl5 -x -S $0 ${1+"$@"} # -*-perl-*- #!perl -w # # Copyright (c) 2000 Carnegie Mellon University. All rights reserved. --- ./master/master.c Tue Apr 1 10:03:09 2003 +++ ../cyrus-imapd-2.1.14/./master/master.c Thu Aug 14 15:10:38 2003 @@ -793,6 +793,7 @@ void sigterm_handler(int sig __attribute__((unused))) { struct sigaction action; + pid_t pid; /* send all the other processes SIGTERM, then exit */ sigemptyset(&action.sa_mask); @@ -802,8 +803,13 @@ syslog(LOG_ERR, "sigaction: %m"); exit(1); } - /* kill my process group */ - if (kill(0, SIGTERM) < 0) { + + /* check that we have our own process group before killing it */ + pid = getpgid(0); + if (pid <= 1) { + syslog(LOG_ERR, "running in pgid %d: %m", pid); + } else if (kill(0, SIGTERM) < 0) { + /* kill my process group */ syslog(LOG_ERR, "kill(0, SIGTERM): %m"); } @@ -1261,6 +1267,17 @@ int fd; fd_set rfds; char *p = NULL; + + /* + * We want to run in our own process group so sigterm_handler() + * can shut everything down cleanly. Make sure we aren't pgid 0 + * (init) or 1 (inetd), since killing them will kill the system. + */ + if (getpgid(0) <= 1) { + pid_t my_pid = getpid(); + if (setpgid(my_pid, my_pid) != 0) + fatal("Unable to change process groups", EX_CONFIG); + } p = getenv("CYRUS_VERBOSE"); if (p) verbose = atoi(p) + 1; --- ./installsieve/mystring.c Thu Feb 13 15:15:37 2003 +++ ../cyrus-imapd-2.1.14/./installsieve/mystring.c Thu Aug 14 15:10:38 2003 @@ -184,7 +184,7 @@ } */ -int safe_to_use_quoted(char *str, int len) +int safe_to_use_quoted(signed char *str, int len) { char *end=str+len; --- ./installsieve/mystring.h Thu Feb 13 15:15:37 2003 +++ ../cyrus-imapd-2.1.14/./installsieve/mystring.h Thu Aug 14 15:10:38 2003 @@ -76,7 +76,7 @@ #define string_DATAPTR(s) (((char *) s)+sizeof(mystring_t)) -int safe_to_use_quoted(char *str, int len); +int safe_to_use_quoted(signed char *str, int len); #endif /* INCLUDED_MYSTRING_H */ --- ./imtest/imtest.c Tue Jun 10 00:11:05 2003 +++ ../cyrus-imapd-2.1.14/./imtest/imtest.c Thu Aug 14 15:10:38 2003 @@ -906,6 +906,7 @@ } else { int c; + /* Should this really be assignment? */ if (((id==SASL_CB_ECHOPROMPT) || (id=SASL_CB_NOECHOPROMPT)) && (challenge != NULL)) { printf("Server challenge: %s\n", challenge); --- ./timsieved/mystring.c Sat May 25 15:57:53 2002 +++ ../cyrus-imapd-2.1.14/./timsieved/mystring.c Thu Aug 14 15:10:38 2003 @@ -123,7 +123,7 @@ return TIMSIEVE_OK; } -int safe_to_use_quoted(char *str, int len) +int safe_to_use_quoted(signed char *str, int len) { char *end=str+len; --- ./timsieved/mystring.h Thu Feb 13 15:15:59 2003 +++ ../cyrus-imapd-2.1.14/./timsieved/mystring.h Thu Aug 14 15:10:38 2003 @@ -77,7 +77,7 @@ #define string_DATAPTR(s) (((char *) s)+sizeof(mystring_t)) -int safe_to_use_quoted(char *str, int len); +int safe_to_use_quoted(signed char *str, int len); #endif /* INCLUDED_MYSTRING_H */ --- ./configure Wed Jul 2 12:55:07 2003 +++ ../cyrus-imapd-2.1.14/./configure Thu Aug 14 16:45:01 2003 @@ -2991,7 +2991,7 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - BDB_LIBADD="$BDB_LIBADD -l$dbname"; + BDB_LIBADD="$BDB_LIBADD -l$dbname ${EXTRA_DBLIBS}"; dblib="berkeley"; break else echo "$ac_t""no" 1>&6