Commit f3a64b68 authored by Matthias Andree's avatar Matthias Andree

Align to master branch.

parent 6bae988b
......@@ -5,10 +5,7 @@ AUTOMAKE_OPTIONS= 1.11 foreign no-dist-gzip dist-xz color-tests parallel-tests s
ACLOCAL_AMFLAGS= -I m4 -I m4-local
AM_YFLAGS= -d
# listing socket.$(OBJEXT) here is a hack to compile socket.c pretty
# early in order to fail it early on outdated OpenSSL libraries,
# without building a few dozen other files first.
BUILT_SOURCES= rcfile_y.h socket.$(OBJEXT)
BUILT_SOURCES= rcfile_y.h
bin_PROGRAMS= fetchmail
......
......@@ -53,13 +53,12 @@ detailed information on recent changes, NOTES for design notes, and TODO for
a list of things that still need doing. If you want to hack on this code,
a list of known bugs and to-do items can be found in the file todo.html.
Status, source code
-------------------
The fetchmail code appears to be stable and free of bugs affecting normal
operation (that is, retrieving from POP3 or IMAP in single-drop mode and
forwarding via SMTP to a local MTA).
forwarding via SMTP to a local mail transfer agent).
You can get the code from the fetchmail home page:
......
......@@ -8,10 +8,11 @@ The prerequisite packages are:
- GNU autoconf >= 2.60
- GNU automake >= 1.8
- GNU gettext >= 0.14.3
- GNU gettext >= 0.18.3
- GNU m4
- GNU bison
- GNU flex >= 2.5.30
- A TLSv1.2-capable OpenSSL version (>= 1.0.2)
After you have everything installed, type:
......
......@@ -10,12 +10,6 @@ The bullet points below mention a few useful hints for package(r)s:
- Fetchmail requires a somewhat recent OpenSSL v1.0.2.
- Fetchmail now uses automake and supports all common automake targets and
overrides such as "make install-strip" or "DESTDIR=..." for staging areas.
- The fetchmailconf script is named fetchmailconf.py, automake will install it
into Python's top-level site-packages directory and byte-compile it (so you
need to package or remove fetchmailconf.pyc and fetchmailconf.pyo as well).
- If you want to defeat Python byte-code compilation and would rather like to
install fetchmailconf.py yourself, you can add
......
......@@ -176,6 +176,29 @@ questionable:
does it expect, what does it get instead, what does that mean, how can the
user fix it; references to the manual)
- grarpamp suggested, on the fetchmail list in later April 2013, more
config file flexibility and explicitness, by marking polls, hosts,
accounts. See thread.
- more selection options, Debian Bug#705291.
- add a way to specify multiple fingerprints per host
- add a way to specify non-MD5 fingerprints per host. SHA1 can be told
from its mere length; other digest algorithms would require some sort
of prefix. We may require the prefix for SHA1, too, for clarity.
- more useful logging, suggested by Jerry, fetchmail-users, 17 May 2013
should include date, time, message-id, and 250 Ok message from
listener that got forwarded to.
- support to present/limit the ciphers and protocols used
ciphers: Martin Koeppe (mkoeppe at gmx dot de) 20130717 on
fetchmail-users list.
protocols: see recent Postfix versions
- add timestamps to local logfiles, proposed by Aaron Sloman
<A.Sloman at cs.bham.ac.uk> 2013-10-16
DOCUMENTATION:
- Add info whether Keywords are global, server or user keywords
......
......@@ -33,10 +33,10 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_AWK
AC_PROG_CC
dnl AC_PROG_CC
AC_PROG_CC_C99
if [ "$ac_cv_prog_cc_c99" = "no" ] ; then
AC_MSG_ERROR([fetchmail requires a C99 capable compiler!])
if test "$ac_cv_prog_cc_c99" = "no" ; then
AC_MSG_WARN([fetchmail requires a C99 capable compiler!])
fi
AM_PROG_CC_C_O
AC_PROG_INSTALL
......@@ -103,20 +103,6 @@ freebsd*)
AC_MSG_NOTICE(found FreeBSD - Adding -lkvm -lcom_err to standard libraries)
LIBS="$LIBS -lkvm -lcom_err"
;;
# Check for LynxOS special case: -lbsd needed (at least on 2.3.0) and -s
# not working.
lynxos*)
AC_MSG_NOTICE(found LynxOS - Adding -lbsd to standard libraries)
LIBS="$LIBS -lbsd"
LDFLAGS=`echo $LDFLAGS | sed "s/-s //"`
AC_MSG_NOTICE(found LynxOS - Prepending standard include path to gcc flags)
CPPFLAGS="$CPPFLAGS -I/usr/include"
;;
# Check for Rhapsody special case: it doesn't like -s
rhapsody*)
AC_MSG_NOTICE(found Rhapsody - Removing -s load flag)
LDFLAGS=`echo $LDFLAGS | sed "s/-s //"`
;;
esac
AC_CACHE_SAVE
......@@ -129,7 +115,7 @@ dnl end i18n
# Under sysV68, socket and friends are provided by the C library.
# -linet does not provide socket, but causes multiple definition
# errors at link-time. It is thus better to only use the C library.
# So don't add -linet to the link list unless it's necessary
# So do not add -linet to the link list unless it's necessary
AC_CHECK_FUNC(socket,
AC_MSG_RESULT(using libc's socket),
AC_CHECK_LIB(socket,socket)
......@@ -149,7 +135,7 @@ dnl strsignal: only in POSIX 2008 (not in 2001)
# Under Red Hat 4.0 (and many other Linuxes) -lresolv is seriously flaky
# and breaks gethostbyname(2). It's better to use the bind stuff in the C
# library. So don't add -lresolv to the link list unless it's necessary
# library. So do not add -lresolv to the link list unless it's necessary
# (It will be necessary when using GNU libc6).
old_LIBS="$LIBS"
for lib in '' -lresolv; do
......@@ -217,7 +203,8 @@ AM_CONDITIONAL(POP2_ENABLE, test "$with_POP2" = yes)
### use option --disable-POP3 to omit the POP3 support
AC_ARG_ENABLE(POP3,
[ --disable-POP3 don't compile in POP3 protocol support],
[AS_HELP_STRING([--disable-POP3],
[do not compile in POP3 protocol support])],
[with_POP3=$enableval],
[with_POP3=yes])
test "$with_POP3" = "yes" && AC_DEFINE(POP3_ENABLE,1,Define if you want POP3 support compiled in)
......@@ -225,7 +212,8 @@ AM_CONDITIONAL(POP3_ENABLE, test "$with_POP3" = yes)
### use option --disable-IMAP to omit the IMAP support
AC_ARG_ENABLE(IMAP,
[ --disable-IMAP don't compile in IMAP protocol support],
[AS_HELP_STRING([--disable-IMAP],
[do not compile in IMAP protocol support])],
[with_IMAP=$enableval],
[with_IMAP=yes])
test "$with_IMAP" = "yes" && AC_DEFINE(IMAP_ENABLE,1,Define if you want IMAP support compiled in)
......@@ -233,7 +221,8 @@ AM_CONDITIONAL(IMAP_ENABLE, test "$with_IMAP" = yes)
### use option --disable-ETRN to omit the ETRN support
AC_ARG_ENABLE(ETRN,
[ --disable-ETRN don't compile in ETRN protocol support],
[AS_HELP_STRING([--disable-ETRN],[do not compile in ETRN protocol
support])],
[with_ETRN=$enableval],
[with_ETRN=yes])
test "$with_ETRN" = "yes" && AC_DEFINE(ETRN_ENABLE,1,Define if you want ETRN support compiled in.)
......@@ -241,7 +230,8 @@ AM_CONDITIONAL(ETRN_ENABLE, test "$with_ETRN" = yes)
### use option --disable-ODMR to omit the ODMR support
AC_ARG_ENABLE(ODMR,
[ --disable-ODMR don't compile in ODMR protocol support],
[AS_HELP_STRING([--disable-ODMR],[do not compile in ODMR protocol
support])],
[with_ODMR=$enableval],
[with_ODMR=yes])
test "$with_ODMR" = "yes" && AC_DEFINE(ODMR_ENABLE,1,Define if you want ODMR support compiled in)
......@@ -249,7 +239,8 @@ AM_CONDITIONAL(ODMR_ENABLE, test "$with_ODMR" = yes)
### use option --enable-RPA to compile in the RPA support
AC_ARG_ENABLE(RPA,
[ --enable-RPA compile in RPA protocol support],
[AS_HELP_STRING([--enable-RPA],[compile in RPA protocol
support])],
[with_RPA=$enableval],
[with_RPA=no])
test "$with_RPA" = "yes" && AC_DEFINE(RPA_ENABLE,1,Define if you want RPA support compiled in)
......@@ -257,7 +248,8 @@ AM_CONDITIONAL(RPA_ENABLE, test "$with_RPA" = yes)
### use option --enable-NTLM to compile in the NTLM support
AC_ARG_ENABLE(NTLM,
[ --enable-NTLM compile in NTLM authentication support],
[AS_HELP_STRING([--enable-NTLM],[compile in NTLM authentication
support])],
[with_NTLM=$enableval],
[with_NTLM=no])
test "$with_NTLM" = "yes" && AC_DEFINE(NTLM_ENABLE,1,Define if you want NTLM authentication)
......@@ -265,7 +257,7 @@ AM_CONDITIONAL(NTLM_ENABLE, test "$with_NTLM" = yes)
### use option --enable-SDPS to compile in the SDPS support
AC_ARG_ENABLE(SDPS,
[ --enable-SDPS compile in SDPS protocol support],
[AS_HELP_STRING([--enable-SDPS],[compile in SDPS protocol support])],
[with_SDPS=$enableval],
[with_SDPS=no])
if test "$with_SDPS" = yes ; then
......@@ -285,14 +277,14 @@ AC_CACHE_SAVE
### use option --enable-opie to compile in the OPIE support
AC_ARG_ENABLE(opie,
[ --enable-opie support OTP through the OPIE library],
[AS_HELP_STRING([--enable-opie],[support one-time passwords
(OTP) through the OPIE library])],
[ AC_CHECK_HEADER(opie.h,, [AC_MSG_ERROR([cannot find <opie.h>, which is required for OPIE support.])])
AC_CHECK_LIB(opie,opiegenerator,, [AC_MSG_ERROR([cannot find libopie, which is required for OPIE support.])])
with_opie=$enableval],
[with_opie=no])
test "$with_opie" = "yes" && AC_DEFINE(OPIE_ENABLE,1,Define if you want OPIE support compiled in)
AC_CHECK_FUNCS(inet_ntop)
dnl Check if getaddrinfo is async-signal-safe - most implementations aren't
AC_MSG_CHECKING(if your getaddrinfo is async-signal-safe)
......@@ -320,14 +312,15 @@ fi
# * Move all the kerberos header mess to kerberos.h, and #include that
# in driver.c and kerberos.c.
#
# Tested using the Heimdal Kerberos V libs, Kungliga Tekniska Hgskolan (the
# Tested using the Heimdal Kerberos V libs, Kungliga Tekniska Högskolan (the
# Royal Institute of Technology in Stockholm, Sweden)'s kerberos IV libs, and
# the MIT reference implementation of KerberosV (all as packaged in Debian).
### use option --with-kerberos5=DIR to point at a Kerberos 5 directory
### make sure --with-ssl is run before --with-kerberos* !
AC_ARG_WITH(kerberos5,
[ --with-kerberos5=DIR point fetchmail compilation at a Kerberos 5 directory],
[AS_HELP_STRING([--with-kerberos5[[=DIR]]],[point fetchmail
compilation at a Kerberos 5 directory])],
[
if test "$with_kerberos5" != "no"
then
......@@ -505,7 +498,9 @@ AM_CONDITIONAL(KERBEROS_V4_ENABLE, test "$KERBEROS_V4" = 1)
### use option --with-ssl to compile in the SSL support
AC_ARG_WITH(ssl,
[ --with-ssl=[DIR] enable SSL support using libraries in DIR],
[AS_HELP_STRING([--with-ssl[[={yes|no|DIR}]]],[Use OpenSSL from
DIR/include/openssl and
DIR/lib (default: yes). Yes means try to find it.])],
[with_ssl=$withval],
[with_ssl=yes])
......@@ -552,7 +547,7 @@ then
AC_MSG_NOTICE(Enabling OpenSSL support in $with_ssl.)
test "$with_ssl" != "/usr" && CFLAGS="$CFLAGS -I$with_ssl/include"
### In Red Hat 9, this file includes a reference to <krb5.h>, so we
### force the Kerberos direcory onto the include path so it will build.
### force the Kerberos directory onto the include path so it will build.
CFLAGS="$CFLAGS -I/usr/kerberos/include"
### OpenBSD comes with ssl headers
else
......@@ -586,13 +581,17 @@ else
fi
case "$LIBS" in *-lssl*)
AC_CHECK_DECLS([TLS1_2_VERSION],,
AC_MSG_ERROR([Your OpenSSL version is too old and does not support TLS v1.2. Upgrade.]),
[#include <openssl/ssl.h>])
AC_CHECK_DECLS([SSLv3_client_method],,,[#include <openssl/ssl.h>])
;;
esac
### use option --with-socks=DIR to point at SOCKS library
AC_ARG_WITH(socks,
[ --with-socks[=DIR] add built-in SOCKS firewall access],
[AS_HELP_STRING([--with-socks[[=DIR]]],[add built-in SOCKS (4)
firewall access])],
[
if test "$with_socks" != no
then
......@@ -610,7 +609,8 @@ fi])
### use option --with-socks5=DIR to point at SOCKS library
AC_ARG_WITH(socks5,
[ --with-socks5[=DIR] add built-in SOCKS5 firewall access],
[AS_HELP_STRING([--with-socks5[[=DIR]]],[add built-in SOCKS5
firewall access])],
[
if test "$with_socks5" != no
then
......@@ -633,7 +633,8 @@ AC_ma_SEARCH_PACKAGE(hesiod, hesiod_getmailhost, /usr/athena /usr /usr/local,hes
### use option --with-gssapi=DIR to compile in GSSAPI support
AC_ARG_WITH(gssapi,
[ --with-gssapi[=DIR] compile in GSSAPI support using libraries in DIR],
[AS_HELP_STRING([--with-gssapi[[=DIR]]],[compile in GSSAPI
support using libraries in DIR])],
[
if test "$with_gssapi" != "no"
then
......
......@@ -14,7 +14,7 @@
#include "socket.h"
#include "i18n.h"
#include "fm_md5.h"
#include "fm_md5.h"
void hmac_md5 (const unsigned char *password, size_t pass_len,
const unsigned char *challenge, size_t chal_len,
......
......@@ -20,9 +20,7 @@
#include <stdlib.h>
#if defined(QNX)
#include <unix.h>
#endif
#include <termios.h> /* for TIOCNOTTY under Linux */
/* BSD portability hack */
#if !defined(SIGCHLD) && defined(SIGCLD)
......
......@@ -17,7 +17,7 @@ a much better one.
<title>The Fetchmail FAQ</title>
<meta name="description"
content="Frequently asked questions about fetchmail."/>
<meta name="keywords" content="fetchmail, POP, POP2, POP3, IMAP, remote mail"/>
<meta name="keywords" content="fetchmail, POP3, IMAP, remote mail"/>
</head>
<body>
<table width="100%" cellpadding="0" summary="Canned page footer">
......@@ -2071,7 +2071,7 @@ SSL?</a></h2>
<p>You'll need to have the <a
href="https://www.openssl.org/">OpenSSL</a> libraries installed, and they
should at least be version 1.0.2.
Configure with --with-ssl. If you have the OpenSSL libraries
Configure with --with-ssl (default since fetchmail v6.4.0). If you have the OpenSSL libraries
installed in commonly-used default locations, this will
suffice. If you have them installed in a non-default location,
you'll need to specify the OpenSSL installation directory as an argument
......
......@@ -26,9 +26,7 @@
#include <socks.h> /* SOCKSinit() */
#endif /* HAVE_SOCKS */
#ifdef HAVE_LANGINFO_H
#include <langinfo.h>
#endif
#include "socket.h"
#include "tunable.h"
......@@ -332,12 +330,7 @@ int main(int argc, char **argv)
/* logging should be set up early in case we were restarted from exec */
if (run.use_syslog)
{
#if defined(LOG_MAIL)
openlog(program_name, LOG_PID, LOG_MAIL);
#else
/* Assume BSD4.2 openlog with two arguments */
openlog(program_name, LOG_PID);
#endif
/* precedence: logfile (if effective) overrides syslog. */
if (run.logfile) {
syslog(LOG_ERR, GT_("syslog and logfile options are both set, ignoring syslog, and logging to %s"), run.logfile);
......@@ -403,8 +396,9 @@ int main(int argc, char **argv)
ctl->server.pollname, ctl->remotename);
/* if we find a matching entry with a password, use it */
if (p && p->password)
{
ctl->password = xstrdup(p->password);
}
/* otherwise try with "via" name if there is one */
else if (ctl->server.via)
{
......@@ -945,7 +939,7 @@ static void optmerge(struct query *h2, struct query *h1, int force)
list_merge(&h2->domainlist, &h1->domainlist, force);
list_merge(&h2->antispam, &h1->antispam, force);
#define FLAG_MERGE(fld) if (force ? !!h1->fld : !h2->fld) h2->fld = h1->fld
#define FLAG_MERGE(fld) do { if (force ? !!h1->fld : !h2->fld) h2->fld = h1->fld; } while (0)
FLAG_MERGE(server.via);
FLAG_MERGE(server.protocol);
FLAG_MERGE(server.service);
......@@ -1552,6 +1546,7 @@ static int query_host(struct query *ctl)
default:
report(stderr, GT_("unsupported protocol selected.\n"));
st = PS_PROTOCOL;
break;
}
/*
......
......@@ -20,10 +20,12 @@ struct addrinfo;
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
#include <stdbool.h>
#include "fm_strl.h"
#include "uid_db.h"
#include "fm_strl.h"
/* constants designating the various supported protocols */
#define P_AUTO 1
......@@ -98,7 +100,7 @@ struct addrinfo;
#define MSGBUFSIZE 8192
#define NAMELEN 64 /* max username length */
#define PASSWORDLEN 64 /* max password length */
#define PASSWORDLEN 256 /* max password length */
#define DIGESTLEN 33 /* length of MD5 digest */
/* exit code values */
......@@ -460,7 +462,7 @@ extern const char *iana_charset; /* IANA assigned charset name */
/* prototypes for globally callable functions */
/* from /usr/include/sys/cdefs.h */
#if !defined __GNUC__ || __GNUC__ < 2
#if !defined __GNUC__
# define __attribute__(xyz) /* Ignore. */
#endif
......@@ -676,12 +678,6 @@ int yylex(void);
#define STRING_DISABLED (char *)-1
#define STRING_DUMMY ""
#ifdef NeXT
#ifndef S_IXGRP
#define S_IXGRP 0000010
#endif
#endif
#ifndef HAVE_STPCPY
char *stpcpy(char *, const char*);
#endif
......@@ -703,8 +699,8 @@ int fm_getaddrinfo(const char *node, const char *serv, const struct addrinfo *hi
void fm_freeaddrinfo(struct addrinfo *ai);
/* prototypes from starttls.c */
int maybe_starttls(struct query *ctl);
int must_starttls(struct query *ctl);
bool maybe_starttls(struct query *ctl);
bool must_starttls(struct query *ctl);
/* prototype from rfc822valid.c */
int rfc822_valid_msgid(const unsigned char *);
......@@ -723,5 +719,8 @@ int ntlm_helper(int sock, struct query *ctl, const char *protocol);
&& !run.use_syslog \
&& (run.showdots || !is_a_file(1)))
/* macro to derive, as compile-time constant, the number of elements in a static vector */
#define countof(ary) (sizeof(ary)/sizeof(ary[0]))
#endif
/* fetchmail.h ends here */
......@@ -10,7 +10,7 @@
.\" Load www macros to process .URL requests, this requires groff:
.mso www.tmac
.\"
.TH fetchmail 1 "fetchmail 6.4.0" "fetchmail" "fetchmail reference manual"
.TH fetchmail 1 "fetchmail 6.5.0-pre" "fetchmail" "fetchmail reference manual"
.SH NAME
fetchmail \- fetch mail from a POP, IMAP, ETRN, or ODMR-capable server
......
......@@ -4,28 +4,22 @@
#include "config.h"
#include "fetchmail.h"
#include <stdint.h>
#include <sys/types.h>
#if SIZEOF_INT == 4
typedef unsigned int uint32;
#else
typedef unsigned long int uint32;
#endif
struct MD5Context {
uint32 buf[4];
uint32 bits[2];
uint32_t buf[4];
uint32_t bits[2];
union {
unsigned char in[64];
uint32 in32[16];
uint32_t in32[16];
} u;
};
void MD5Init(struct MD5Context *context);
void MD5Update(struct MD5Context *context, const void *buf, unsigned len);
void MD5Final(void *digest, struct MD5Context *context);
void MD5Transform(uint32 buf[4], uint32 const in[16]);
void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
/*
* This is needed to make RSAREF happy on some MS-DOS compilers.
......
......@@ -79,21 +79,6 @@ void save_str_pair(struct idlist **idl, const char *str1, const char *str2)
(*end)->next = (struct idlist *)NULL;
}
#ifdef __UNUSED__
void free_str_pair_list(struct idlist **idl)
/* free the given ID pair list */
{
if (*idl == (struct idlist *)NULL)
return;
free_idpair_list(&(*idl)->next);
free ((*idl)->id);
free ((*idl)->val.id2);
free(*idl);
*idl = (struct idlist *)NULL;
}
#endif
/** Check if ID \a str is in idlist \a idl. \return idlist entry if found,
* NULL if not found. */
struct idlist *str_in_list(struct idlist **idl, const char *str,
......
......@@ -626,15 +626,6 @@ static int imap_getauth(int sock, struct query *ctl, char *greeting)
}
#endif /* NTLM_ENABLE */
#ifdef __UNUSED__ /* The Cyrus IMAP4rev1 server chokes on this */
/* this handles either AUTH=LOGIN or AUTH-LOGIN */
if ((imap_version >= IMAP4rev1) && (!strstr(capabilities, "LOGIN")))
{
report(stderr,
GT_("Required LOGIN capability not supported by server\n"));
}
#endif /* __UNUSED__ */
/*
* We're stuck with sending the password en clair.
* The reason for this odd-looking logic is that some
......
......@@ -33,18 +33,16 @@
#include <net/if.h>
#if defined(__FreeBSD__)
# if defined __FreeBSD_USE_KVM
# if __FreeBSD_version >= 300001
# include <net/if_var.h>
# endif
# include <net/if_var.h>
# include <kvm.h>
# include <nlist.h>
# include <sys/fcntl.h>
# else
#else
# include <sys/sysctl.h>
# include <net/route.h>
# include <net/if_dl.h>
# endif
#endif
# endif /* defined __FreeBSD_USE_KVM */
#endif /* defined __FreeBSD__ */
#include "socket.h"
#include "i18n.h"
#include "tunable.h"
......@@ -227,10 +225,8 @@ get_ifinfo(const char *ifname, ifinfo_t *ifinfo)
char iname[16];
struct ifnet ifnet;
unsigned long ifnet_addr = ifnet_savedaddr;
#if __FreeBSD_version >= 300001
struct ifnethead ifnethead;
struct ifaddrhead ifaddrhead;
#endif
struct ifaddr ifaddr;
unsigned long ifaddr_addr;
struct sockaddr sa;
......@@ -256,12 +252,8 @@ get_ifinfo(const char *ifname, ifinfo_t *ifinfo)
}
}
#if __FreeBSD_version >= 300001
kvm_read(kvmfd, ifnet_savedaddr, (char *) &ifnethead, sizeof ifnethead);
ifnet_addr = (u_long) ifnethead.tqh_first;
#else
ifnet_addr = ifnet_savedaddr;
#endif
while (ifnet_addr)
{
......@@ -281,11 +273,7 @@ get_ifinfo(const char *ifname, ifinfo_t *ifinfo)
ifinfo->rx_packets = ifnet.if_ipackets;
ifinfo->tx_packets = ifnet.if_opackets;
#if __FreeBSD_version >= 300001
ifaddr_addr = (u_long) ifnet.if_addrhead.tqh_first;
#else
ifaddr_addr = (u_long) ifnet.if_addrlist;
#endif
while(ifaddr_addr)
{
......@@ -294,11 +282,7 @@ get_ifinfo(const char *ifname, ifinfo_t *ifinfo)
if (sa.sa_family != AF_INET)
{
#if __FreeBSD_version >= 300001
ifaddr_addr = (u_long) ifaddr.ifa_link.tqe_next;
#else
ifaddr_addr = (u_long) ifaddr.ifa_next;
#endif
continue;
}
......@@ -320,11 +304,7 @@ get_ifinfo(const char *ifname, ifinfo_t *ifinfo)
return 0;
}
#if __FreeBSD_version >= 300001
ifnet_addr = (u_long) ifnet.if_link.tqe_next;
#else
ifnet_addr = (unsigned long) ifnet.if_next;
#endif
}
if (if_egid)
......
......@@ -6,13 +6,15 @@
#ifndef H_KERBEROS__
#define H_KERBEROS__
#include "config.h"
#if defined(KERBEROS_V4) || defined(KERBEROS_V5)
#ifdef KERBEROS_V5
#include <krb5.h>
/* #include <com_err.h> */
#endif
#endif /* KERBEROS_V5 */
#ifdef KERBEROS_V4
# ifdef KERBEROS_V4_V5
......
......@@ -30,8 +30,7 @@ void fm_lock_release(void);
*/
int fm_lock_state(void);
/** If atexit(3) is available on the system this software is compiled on,
* register an exit handler to dipose of the lock on process exit. */
/** Register an atexit() exit handler to dipose of the lock on process exit. */
void fm_lock_dispose(void);
#endif
......@@ -17,9 +17,7 @@
#include "config.h"
#include "fm_md5.h"
#include <string.h> /* memmove */
#include <inttypes.h>
/*
......
......@@ -10,6 +10,7 @@
***********************************************************************/
#include "fetchmail.h"
#include "fm_md5.h"
#include <stdio.h>
......
......@@ -15,13 +15,6 @@
# define __END_DECLS /* empty */
#endif
#undef __P
#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
# define __P(protos) protos
#else
# define __P(protos) ()
#endif
/* The structure used to return account information from the .netrc. */
typedef struct _netrc_entry {
/* The exact host name given in the .netrc, NULL if default. */
......@@ -41,14 +34,14 @@ __BEGIN_DECLS
/* Parse FILE as a .netrc file (as described in ftp(1)), and return a
list of entries. NULL is returned if the file could not be
parsed. */
netrc_entry *parse_netrc __P((char *file));
netrc_entry *parse_netrc (char *file);
/* Return the netrc entry from LIST corresponding to HOST. NULL is
returned if no such entry exists. */
netrc_entry *search_netrc __P((netrc_entry *list, char *host, char *account));
netrc_entry *search_netrc (netrc_entry *list, char *host, char *account);
/* Free the netrc list structure */
void free_netrc __P((netrc_entry *list));
void free_netrc (netrc_entry *list);
__END_DECLS
#endif /* _NETRC_H_ */
......@@ -42,7 +42,7 @@ int do_otp(int sock, const char *command, struct query *ctl)
return PS_AUTHFAIL;
}
to64frombits(buffer, ctl->remotename, strlen(ctl->remotename), sizeof buffer);
to64frombits(buffer, ctl->remotename, strlen(ctl->remotename), sizeof(buffer));
suppress_tags = TRUE;
gen_send(sock, "%s", buffer);
suppress_tags = FALSE;
......@@ -69,7 +69,7 @@ int do_otp(int sock, const char *command, struct query *ctl)
if (rval)
return(PS_AUTHFAIL);
to64frombits(buffer, response, strlen(response), sizeof buffer);
to64frombits(buffer, response, strlen(response), sizeof(buffer));
suppress_tags = TRUE;
gen_send(sock, "%s", buffer);
suppress_tags = FALSE;
......
......@@ -158,7 +158,6 @@ static const struct option longoptions[] = {
static int xatoi(char *s, int *errflagptr)
/* do safe conversion from string to number */
{
#if defined (LONG_MAX) && defined (INT_MAX)
/* parse and convert numbers, but also check for invalid characters in