diff -Naur fetchmail-6.2.5.orig/configure.in fetchmail-6.2.5/configure.in --- fetchmail-6.2.5.orig/configure.in 2003-10-10 14:06:57.000000000 +0530 +++ fetchmail-6.2.5/configure.in 2003-11-07 07:59:50.000000000 +0530 @@ -25,12 +25,14 @@ AC_ISC_POSIX AC_MINIX AC_HEADER_STDC +AC_HEADER_TIME AC_TYPE_SIZE_T AC_TYPE_PID_T AC_TYPE_SIGNAL AC_CHECK_HEADERS(unistd.h termios.h termio.h sgtty.h stdarg.h alloca.h) AC_CHECK_HEADERS(sys/itimer.h fcntl.h sys/fcntl.h memory.h sys/wait.h sys/shm.h) AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h resolv.h net/socket.h sys/select.h) +AC_CHECK_HEADERS(sys/time.h) AC_C_CONST dnl getopt needs this. @@ -572,15 +574,18 @@ # This will screw up if an OpenSSL install is located in a later # directory than an older SSLeay install, but the user should fix that # anyways and he can override on the configure line. + # Just testing for directories is not sufficient, /usr exists on + # all systems! for ac_dir in \ /usr/local/ssl \ + /usr/local \ /usr/ssl \ /usr \ /local/ssl \ /opt/ssl \ ; \ do - if test -d "$ac_dir" ; then + if test -r "$ac_dir/include/openssl/ssl.h" ; then with_ssl=$ac_dir break; fi @@ -600,18 +605,14 @@ if test -r $with_ssl/include/openssl/ssl.h then ### ssl.h found under openssl. Use openssl configuration preferentially, + echo "Enabling OpenSSL support in $with_ssl" + test "$with_ssl" != "/usr" && CEFLAGS="$CEFLAGS -I$with_ssl/include" ### In Red Hat 9, this file includes a reference to , so we ### force the Kerberos direcory onto the include path so it will build. - echo "Enabling OpenSSL support in $with_ssl" - CEFLAGS="$CEFLAGS -I$with_ssl/include -I/usr/kerberos/include" + CEFLAGS="$CEFLAGS -I/usr/kerberos/include" ### OpenBSD comes with ssl headers - elif test -r /usr/include/ssl/ssl.h - then - echo "Enabling SSLeay support in $with_ssl" - CEFLAGS="$CEFLAGS -I/usr/include/ssl" else - echo "Enabling SSLeay support in $with_ssl" - test "$with_ssl" != "/usr" && CEFLAGS="$CEFLAGS -I$with_ssl/include" + AC_ERROR([SSL support enabled, but OpenSSL not found]) fi LDEFLAGS="$LDEFLAGS -L$with_ssl/lib" LIBS="$LIBS -lssl -lcrypto" diff -Naur fetchmail-6.2.5.orig/driver.c fetchmail-6.2.5/driver.c --- fetchmail-6.2.5.orig/driver.c 2003-11-07 07:59:34.000000000 +0530 +++ fetchmail-6.2.5/driver.c 2003-11-07 07:59:50.000000000 +0530 @@ -23,7 +23,6 @@ #if defined(HAVE_SYS_ITIMER_H) #include #endif -#include #include #ifdef HAVE_SYS_WAIT_H #include diff -Naur fetchmail-6.2.5.orig/env.c fetchmail-6.2.5/env.c --- fetchmail-6.2.5.orig/env.c 2003-07-17 06:33:20.000000000 +0530 +++ fetchmail-6.2.5/env.c 2003-11-07 07:59:50.000000000 +0530 @@ -23,12 +23,10 @@ #include #endif /* HAVE_GETHOSTBYNAME */ #include -#include #include "fetchmail.h" #include "i18n.h" #if defined(HAVE_SETLOCALE) && defined(ENABLE_NLS) && defined(HAVE_STRFTIME) -#include #include #endif diff -Naur fetchmail-6.2.5.orig/fetchmail.c fetchmail-6.2.5/fetchmail.c --- fetchmail-6.2.5.orig/fetchmail.c 2003-10-16 00:52:31.000000000 +0530 +++ fetchmail-6.2.5/fetchmail.c 2003-11-07 07:59:50.000000000 +0530 @@ -25,7 +25,6 @@ #include #include #include -#include /* needed for Sun 4.1.2 */ #ifdef HAVE_SETRLIMIT #include #endif /* HAVE_SETRLIMIT */ @@ -99,7 +98,6 @@ #endif #if defined(HAVE_SETLOCALE) && defined(ENABLE_NLS) && defined(HAVE_STRFTIME) -#include #include static char *timestamp (void) { diff -Naur fetchmail-6.2.5.orig/fetchmail.h fetchmail-6.2.5/fetchmail.h --- fetchmail-6.2.5.orig/fetchmail.h 2003-10-16 00:52:31.000000000 +0530 +++ fetchmail-6.2.5/fetchmail.h 2003-11-07 08:02:30.000000000 +0530 @@ -8,6 +8,18 @@ /* We need this for size_t */ #include +/* We need this for time_t */ +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + /* constants designating the various supported protocols */ #define P_AUTO 1 #define P_POP2 2 diff -Naur fetchmail-6.2.5.orig/idle.c fetchmail-6.2.5/idle.c --- fetchmail-6.2.5.orig/idle.c 2003-07-17 06:33:22.000000000 +0530 +++ fetchmail-6.2.5/idle.c 2003-11-07 07:59:50.000000000 +0530 @@ -21,7 +21,6 @@ #include #include #include -#include #include /* for ROOT_UID */ #ifndef TRUE diff -Naur fetchmail-6.2.5.orig/odmr.c fetchmail-6.2.5/odmr.c --- fetchmail-6.2.5.orig/odmr.c 2003-10-16 00:47:42.000000000 +0530 +++ fetchmail-6.2.5/odmr.c 2003-11-07 07:59:50.000000000 +0530 @@ -16,7 +16,6 @@ #include #endif #include -#include #ifdef HAVE_NET_SELECT_H /* AIX needs this */ #include #endif diff -Naur fetchmail-6.2.5.orig/sink.c fetchmail-6.2.5/sink.c --- fetchmail-6.2.5.orig/sink.c 2003-10-11 03:36:36.000000000 +0530 +++ fetchmail-6.2.5/sink.c 2003-11-07 11:06:00.000000000 +0530 @@ -15,7 +15,6 @@ #include #include #include -#include #ifdef HAVE_MEMORY_H #include #endif /* HAVE_MEMORY_H */ @@ -31,12 +30,10 @@ #include #endif #include -#include /* for W* macros after pclose() */ #define _USE_BSD #include -#include #include #include @@ -224,7 +221,7 @@ else if (ctl->smtphost && ctl->smtphost[0] != '/') { char * cp; - if (cp = strchr (ctl->smtphost, '/')) + if ((cp = strchr (ctl->smtphost, '/'))) { /* As an alternate port for smtphost is specified, we need to strip it from domain name. */ @@ -702,7 +699,7 @@ n = 0; if (ctl->mda || ctl->bsmtp) - n = fwrite(buf, 1, last - buf, sinkfp); + n = fwrite(buf, last - buf, 1, sinkfp); else if (ctl->smtp_socket != -1) n = SockWrite(ctl->smtp_socket, buf, last - buf); diff -Naur fetchmail-6.2.5.orig/smtp.h fetchmail-6.2.5/smtp.h --- fetchmail-6.2.5.orig/smtp.h 2003-08-06 09:00:18.000000000 +0530 +++ fetchmail-6.2.5/smtp.h 2003-11-07 07:59:50.000000000 +0530 @@ -7,7 +7,7 @@ #ifndef _POPSMTP_ #define _POPSMTP_ -#include +#include "config.h" #define SMTPBUFSIZE 256 diff -Naur fetchmail-6.2.5.orig/socket.c fetchmail-6.2.5/socket.c --- fetchmail-6.2.5.orig/socket.c 2003-10-10 16:02:15.000000000 +0530 +++ fetchmail-6.2.5/socket.c 2003-11-07 07:59:50.000000000 +0530 @@ -200,7 +200,6 @@ #endif /* HAVE_SOCKETPAIR */ #ifdef __UNUSED__ -#include int SockCheckOpen(int fd) /* poll given socket; is it selectable? */ @@ -502,10 +501,11 @@ } #ifdef SSL_ENABLE -#include "openssl/ssl.h" -#include "openssl/err.h" -#include "openssl/pem.h" -#include "openssl/x509.h" +#include +#include +#include +#include +#include static SSL_CTX *_ctx = NULL; static SSL *_ssl_context[FD_SETSIZE]; @@ -759,7 +759,7 @@ int err, depth; unsigned char digest[EVP_MAX_MD_SIZE]; char text[EVP_MAX_MD_SIZE * 3 + 1], *tp, *te; - EVP_MD *digest_tp; + const EVP_MD *digest_tp; unsigned int dsz, i, esz; X509_NAME *subj, *issuer;