diff -u3pr mailutils-1.2~/configure.ac mailutils-1.2/configure.ac --- mailutils-1.2~/configure.ac Fri Jun 29 05:36:20 2007 +++ mailutils-1.2/configure.ac Sun Oct 7 22:23:53 2007 @@ -61,6 +61,7 @@ AC_PROG_INSTALL AC_PROG_LN_S AC_LIBTOOL_DLOPEN AC_PROG_LIBTOOL +AC_PROG_RANLIB AC_PROG_YACC AM_PROG_LEX @@ -245,7 +246,7 @@ AH_BOTTOM([ # include #endif #ifndef _PATH_MAILDIR -# if (defined(sun) && defined(__svr4__)) || defined(__SVR4) +# if (defined(sun) && defined(__svr4__)) || defined(__SVR4) || defined(__hpux) # define _PATH_MAILDIR "/var/mail" # else # define _PATH_MAILDIR "/usr/spool/mail" @@ -423,6 +424,15 @@ AC_CHECK_DECLS([strtok_r, strchrnul, str # include #endif]) +AC_CHECK_DECLS([vsyslog], + , , [ +#ifdef HAVE_SYSLOG_H +# include +#endif +#ifdef HAVE_STDARG_H +#include +#endif]) + AC_CHECK_DECLS(environ, , , [ #include #include ]) @@ -434,10 +444,16 @@ extern char *strtok_r (char *s, const ch #if !HAVE_DECL_STRSIGNAL extern char *strsignal (int); #endif +#if !HAVE_DECL_VSYSLOG +#ifdef HAVE_STDARG_H +# include +#endif +void vsyslog (int, const char *, va_list); +#endif ]) AC_CHECK_FUNCS(mkstemp sigaction sysconf getdelim setreuid \ - setresuid seteuid setlocale vfork _exit) + setresuid setegid seteuid setlocale strsignal vfork _exit) AC_FUNC_FSEEKO AC_FUNC_SETVBUF_REVERSED diff -u3pr mailutils-1.2~/dotlock/dotlock.c mailutils-1.2/dotlock/dotlock.c --- mailutils-1.2~/dotlock/dotlock.c Wed Jun 27 08:07:40 2007 +++ mailutils-1.2/dotlock/dotlock.c Sun Oct 7 22:31:03 2007 @@ -32,6 +32,12 @@ #include #include +#ifdef HAVE_SETEGID +# define SETEGID setegid +#else +# define SETEGID setgid +#endif + const char *program_version = "GNU dotlock (" PACKAGE_STRING ")"; static char doc[] = N_("GNU dotlock -- lock mail spool files") @@ -135,7 +141,7 @@ main (int argc, char *argv[]) /* Drop permissions during argument parsing. */ - if (setegid (usergid) < 0) + if (SETEGID (usergid) < 0) return MU_DL_EX_ERROR; mu_argp_init (program_version, NULL); @@ -157,7 +163,7 @@ main (int argc, char *argv[]) if (retries != 0) mu_locker_set_retries (locker, retries); - if (setegid (mailgid) < 0) + if (SETEGID (mailgid) < 0) return MU_DL_EX_ERROR; if (unlock) @@ -165,7 +171,7 @@ main (int argc, char *argv[]) else err = mu_locker_lock (locker); - setegid(usergid); + SETEGID(usergid); mu_locker_destroy (&locker); diff -u3pr mailutils-1.2~/examples/mta.c mailutils-1.2/examples/mta.c --- mailutils-1.2~/examples/mta.c Wed Jun 27 08:07:40 2007 +++ mailutils-1.2/examples/mta.c Fri Oct 5 22:03:17 2007 @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #include diff -u3pr mailutils-1.2~/imap4d/signal.c mailutils-1.2/imap4d/signal.c --- mailutils-1.2~/imap4d/signal.c Wed Jun 27 08:07:40 2007 +++ mailutils-1.2/imap4d/signal.c Sat Oct 6 01:13:39 2007 @@ -39,7 +39,11 @@ imap4d_sigchld (int signo) RETSIGTYPE imap4d_signal (int signo) { +#ifdef HAVE_STRSIGNAL syslog (LOG_CRIT, _("Got signal %s"), strsignal (signo)); +#else + syslog (LOG_CRIT, _("Got signal %d"), signo); +#endif /* Master process. */ if (util_is_master ()) { diff -u3pr mailutils-1.2~/lib/Makefile.am mailutils-1.2/lib/Makefile.am --- mailutils-1.2~/lib/Makefile.am Wed Jun 27 08:07:41 2007 +++ mailutils-1.2/lib/Makefile.am Sat Oct 6 20:59:01 2007 @@ -25,9 +25,10 @@ INCLUDES = @MU_COMMON_INCLUDES@ @INTLINC libmuaux_la_SOURCES = \ daemon.c\ mailcap.c\ - mu_dbm.c + mu_dbm.c \ + vsyslog.c -EXTRA_DIST = utmp.c +EXTRA_DIST = utmp.c noinst_HEADERS =\ mu_dbm.h\ diff -u3pr mailutils-1.2~/lib/obstack.c mailutils-1.2/lib/obstack.c --- mailutils-1.2~/lib/obstack.c Sun Sep 10 07:04:27 2006 +++ mailutils-1.2/lib/obstack.c Fri Oct 5 21:17:25 2007 @@ -55,7 +55,11 @@ #ifndef ELIDE_CODE +#ifdef __hpux +#include +#else # include +#endif /* Determine default alignment. */ union fooround diff -u3pr mailutils-1.2~/mailbox/inttostr.h mailutils-1.2/mailbox/inttostr.h --- mailutils-1.2~/mailbox/inttostr.h Sun Sep 10 07:04:28 2006 +++ mailutils-1.2/mailbox/inttostr.h Fri Oct 5 20:43:27 2007 @@ -19,7 +19,11 @@ /* Written by Paul Eggert */ +#ifdef __hpux +#include +#else #include +#endif #include #include "intprops.h" diff -u3pr mailutils-1.2~/mailbox/md5.h mailutils-1.2/mailbox/md5.h --- mailutils-1.2~/mailbox/md5.h Sun Sep 10 07:04:28 2006 +++ mailutils-1.2/mailbox/md5.h Fri Oct 5 20:31:47 2007 @@ -22,7 +22,11 @@ #define _MD5_H 1 #include +#ifdef __hpux +#include +#else #include +#endif #define MD5_DIGEST_SIZE 16 #define MD5_BLOCK_SIZE 64 diff -u3pr mailutils-1.2~/mailbox/mutil.c mailutils-1.2/mailbox/mutil.c --- mailutils-1.2~/mailbox/mutil.c Wed Jun 27 15:38:09 2007 +++ mailutils-1.2/mailbox/mutil.c Fri Oct 5 19:43:07 2007 @@ -36,7 +36,9 @@ #include #include #include +#ifndef __hpux #include +#endif #ifdef HAVE_STRINGS_H #include diff -u3pr mailutils-1.2~/pop3d/signal.c mailutils-1.2/pop3d/signal.c --- mailutils-1.2~/pop3d/signal.c Thu Jun 28 10:32:55 2007 +++ mailutils-1.2/pop3d/signal.c Sat Oct 6 01:12:05 2007 @@ -50,7 +50,11 @@ pop3d_signal (int signo) { int code; +#ifdef HAVE_STRSIGNAL syslog (LOG_CRIT, _("Got signal %s"), strsignal (signo)); +#else + syslog (LOG_CRIT, _("Got signal %d"), signo); +#endif /* Master process. */ if (pop3d_is_master ()) --- /dev/null Mon Oct 8 12:03:32 2007 +++ mailutils-1.2/lib/vsyslog.c Sat Oct 6 01:15:47 2007 @@ -0,0 +1,17 @@ +#include +#include +#include +#include + +void +vsyslog(pri, fmt, ap) + int pri; + register const char *fmt; + va_list ap; +{ + char tbuf[2048]; + + (void) vsnprintf (tbuf, 2048, fmt, ap); + (void) syslog (pri, tbuf); + return; +}