# REMOVED FEATURES
* POP2 was long obsolete and removed
+* BeOS and EMX support was removed
--------------------------------------------------------------------------------
dnl
dnl XXX - if bumping version here, check fetchmail.man, too!
-AC_INIT([fetchmail],[6.3.19],[fetchmail-users@lists.berlios.de])
+AC_INIT([fetchmail],[6.4.0-alpha1],[fetchmail-devel@lists.berlios.de])
AC_CONFIG_SRCDIR([fetchmail.h])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_LIBOBJ_DIR([.])
AM_PROG_CC_C_O
AC_USE_SYSTEM_EXTENSIONS
-AC_ISC_POSIX
-dnl AC_ISC_POSIX: - XXX FIXME: remove in fetchmail 6.4.
-dnl This macro adds `-lcposix' to output variable `LIBS' if necessary
-dnl for Posix facilities. Sun dropped support for the obsolete
-dnl INTERACTIVE Systems Corporation Unix on 2006-07-23. New programs
-dnl need not use this macro. It is implemented as
-dnl `AC_SEARCH_LIBS([strerror], [cposix])'
-
dnl check for b0rked Solaris (and other shells) and find one that works
AC_MSG_CHECKING(for a working shell...)
for i in /usr/xpg6/bin/sh /usr/xpg4/bin/sh /usr/ccs/bin/sh /bin/sh /usr/bin/sh /bin/ksh /bin/bash /usr/local/bin/bash ; do
}
#elif defined(SIGTSTP) /* BSD */
/* change process group */
-#ifndef __EMX__
setpgrp(0, getpid());
-#endif
/* lose controlling tty */
if ((fd = open("/dev/tty", O_RDWR)) >= 0) {
ioctl(fd, TIOCNOTTY, (char *) 0);
}
#else /* SVR3 and older */
/* change process group */
-#ifndef __EMX__
setpgrp();
-#endif
/* lose controlling tty */
set_signal_handler(SIGHUP, SIG_IGN);
void set_timeout(int timeleft)
/* reset the nonresponse-timeout */
{
-#if !defined(__EMX__) && !defined(__BEOS__)
struct itimerval ntimeout;
if (timeleft == 0)
ntimeout.it_value.tv_sec = timeleft;
ntimeout.it_value.tv_usec = 0;
setitimer(ITIMER_REAL, &ntimeout, (struct itimerval *)NULL);
-#endif
}
static RETSIGTYPE timeout_handler (int signal)
/* 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
report_init(-1);
}
else
void yyerror(const char *);
int yylex(void);
-#ifdef __EMX__
-void itimerthread(void*);
-/* Have to include these first to avoid errors from redefining getcwd
- and chdir. They're re-include protected in EMX, so it's okay, I
- guess. */
-#include <stdlib.h>
-#include <unistd.h>
-/* Redefine getcwd and chdir to get drive-letter support so we can
- find all of our lock files and stuff. */
-#define getcwd _getcwd2
-#define chdir _chdir2
-#endif /* _EMX_ */
-
#ifdef HAVE_STRERROR
# if !defined(strerror) && !defined(HAVE_DECL_STRERROR) /* On some systems, strerror is a macro */
char *strerror (int);
}
#endif /* SLEEP_WITH_ALARM */
-#ifdef __EMX__
-/* Various EMX-specific definitions */
-static int itimerflag;
-
-void itimerthread(void* dummy)
-{
- if (outlevel >= O_VERBOSE)
- report(stderr,
- GT_("fetchmail: thread sleeping for %d sec.\n"), poll_interval);
- while(1)
- {
- _sleep2(poll_interval*1000);
- kill((getpid()), SIGALRM);
- }
-}
-#endif
-
int interruptible_idle(int seconds)
/* time for a pause in the action; return TRUE if awakened by signal */
{
int awoken = FALSE;
-#ifndef __EMX__
#ifdef SLEEP_WITH_ALARM /* not normally on */
/*
* We can't use sleep(3) here because we need an alarm(3)
} while (lastsig == SIGCHLD);
}
#endif
-#else /* EMX */
- alarm_latch = FALSE;
- set_signal_handler(SIGALRM, gotsigalrm);
- _beginthread(itimerthread, NULL, 32768, NULL);
- /* see similar code above */
- if (!alarm_latch)
- pause();
- set_signal_handler(SIGALRM, SIG_IGN);
-#endif /* ! EMX */
if (lastsig == SIGUSR1 || ((seconds && getuid() == ROOT_UID)
&& lastsig == SIGHUP))
awoken = TRUE;
#include <net/if.h>
#if defined(__FreeBSD__)
#if defined __FreeBSD_USE_KVM
-#if __FreeBSD_version >= 300001
#include <net/if_var.h>
-#endif
#include <kvm.h>
#include <nlist.h>
#include <sys/fcntl.h>
-#else
+#else /* !defined __FreeBSD_USE_KVM */
#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"
#include <sys/types.h>
#include <netinet/in.h>
-#ifdef __BEOS__
-#include "beos/beos_nameser.h"
-#endif
-
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif
# 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. */
/* 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_ */
#ifdef HAVE_STRING_H /* strcat() */
#include <string.h>
#endif
-#ifdef HAVE_NET_SOCKET_H /* BeOS needs this */
-#include <net/socket.h>
-#endif
#include <sys/types.h>
#ifdef HAVE_NET_SELECT_H /* AIX needs this */
#include <net/select.h>
int prc_filecheck(const char *pathname,
const flag securecheck /** shortcuts permission, filetype and uid tests if false */)
{
-#ifndef __EMX__
struct stat statbuf;
errno = 0;
return(PS_IOERR);
}
-#ifndef __BEOS__
#ifdef __CYGWIN__
if (cygwin_internal(CW_CHECK_NTSEC, pathname))
#endif /* __CYGWIN__ */
pathname);
return(PS_IOERR);
}
-#endif /* __BEOS__ */
#ifdef HAVE_GETEUID
if (statbuf.st_uid != geteuid())
fprintf(stderr, GT_("File %s must be owned by you.\n"), pathname);
return(PS_IOERR);
}
-#endif
return(PS_SUCCESS);
}
#include "smbencrypt.h"
#include "smbmd4.h"
-#ifndef _AIX
-typedef unsigned char uchar;
-typedef signed short int16;
-#endif
typedef int BOOL;
#define False 0
#define True 1
}
}
-extern void SMBOWFencrypt(uchar passwd[16], uchar *c8, uchar p24[24]);
+extern void SMBOWFencrypt(unsigned char passwd[16], unsigned char *c8, unsigned char p24[24]);
/*
This implements the X/Open SMB password encryption
encrypted password into p24
*/
-void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24)
+void SMBencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24)
{
- uchar p14[15], p21[21];
+ unsigned char p14[15], p21[21];
memset(p21,'\0',21);
memset(p14,'\0',14);
}
/* Routines for Windows NT MD4 Hash functions. */
-static int _my_wcslen(int16 *str)
+static int _my_wcslen(int16_t *str)
{
int len = 0;
while(*str++ != 0)
* format.
*/
-static int _my_mbstowcs(int16 *dst, uchar *src, int len)
+static int _my_mbstowcs(int16_t *dst, unsigned char *src, int len)
{
int i;
- int16 val;
+ int16_t val;
for(i = 0; i < len; i++) {
val = *src;
static void E_md4hash(uchar *passwd, uchar *p16)
{
int len;
- int16 wpwd[129];
+ int16_t wpwd[129];
/* Password cannot be longer than 128 characters */
len = strlen((char *)passwd);
_my_mbstowcs(wpwd, passwd, len);
wpwd[len] = 0; /* Ensure string is null terminated */
/* Calculate length in bytes */
- len = _my_wcslen(wpwd) * sizeof(int16);
+ len = _my_wcslen(wpwd) * sizeof(int16_t);
mdfour(p16, (unsigned char *)wpwd, len);
}
/* Does the des encryption from the NT or LM MD4 hash. */
-void SMBOWFencrypt(uchar passwd[16], uchar *c8, uchar p24[24])
+void SMBOWFencrypt(unsigned char passwd[16], unsigned char *c8, unsigned char p24[24])
{
- uchar p21[21];
+ unsigned char p21[21];
memset(p21,'\0',21);
/* Does the NT MD4 hash then des encryption. */
-void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24)
+void SMBNTencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24)
{
- uchar p21[21];
+ unsigned char p21[21];
memset(p21,'\0',21);
#if 0
-BOOL make_oem_passwd_hash(char data[516], const char *passwd, uchar old_pw_hash[16], BOOL unicode)
+BOOL make_oem_passwd_hash(char data[516], const char *passwd, unsigned char old_pw_hash[16], BOOL unicode)
{
int new_pw_len = strlen(passwd) * (unicode ? 2 : 1);
#include "i18n.h"
#include "sdump.h"
-/* Defines to allow BeOS and Cygwin to play nice... */
-#ifdef __BEOS__
-static char peeked;
-#define fm_close(a) closesocket(a)
-#define fm_write(a,b,c) send(a,b,c,0)
-#define fm_peek(a,b,c) recv(a,b,c,0)
-#define fm_read(a,b,c) recv(a,b,c,0)
-#else
-#define fm_close(a) close(a)
+/* Defines to allow Cygwin to play nice... */
+#define fm_close(a) close(a)
#define fm_write(a,b,c) write(a,b,c)
#define fm_peek(a,b,c) recv(a,b,c, MSG_PEEK)
+
#ifdef __CYGWIN__
#define fm_read(a,b,c) cygwin_read(a,b,c)
static ssize_t cygwin_read(int sock, void *buf, size_t count);
#else /* ! __CYGWIN__ */
#define fm_read(a,b,c) read(a,b,c)
#endif /* __CYGWIN__ */
-#endif
/* We need to define h_errno only if it is not already */
#ifndef h_errno
if (--len < 1)
return(-1);
-#ifdef __BEOS__
- if (peeked != 0){
- (*bp) = peeked;
- bp++;
- len--;
- peeked = 0;
- }
-#endif
do {
/*
* The reason for these gymnastics is that we want two things:
#endif /* SSL_ENABLE */
{
-#ifdef __BEOS__
- if ((n = fm_read(sock, bp, 1)) <= 0)
-#else
if ((n = fm_peek(sock, bp, len)) <= 0)
-#endif
return (-1);
if ((newline = (char *)memchr(bp, '\n', n)) != NULL)
n = newline - bp + 1;
-#ifndef __BEOS__
if ((n = fm_read(sock, bp, n)) == -1)
return(-1);
-#endif /* __BEOS__ */
}
bp += n;
len -= n;
if (n == -1)
return -1;
-#ifdef __BEOS__
- peeked = ch;
-#endif
return(ch);
}