diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2000-08-12 22:19:16 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2000-08-12 22:19:16 +0000 |
commit | 74c280481f7b3087059573dc63b94ac093b17466 (patch) | |
tree | 7f1b2dddabe7373f19a658433a351ef5464ef883 /contrib/sendmail/src/conf.h | |
parent | c3cd75415d60bc002b20182ffd3383ea9e901a80 (diff) | |
download | FreeBSD-src-74c280481f7b3087059573dc63b94ac093b17466.zip FreeBSD-src-74c280481f7b3087059573dc63b94ac093b17466.tar.gz |
Fix conflicts from merge of sendmail 8.11.0.
PR: bin/11552 misc/18512 bin/15088
Diffstat (limited to 'contrib/sendmail/src/conf.h')
-rw-r--r-- | contrib/sendmail/src/conf.h | 1372 |
1 files changed, 823 insertions, 549 deletions
diff --git a/contrib/sendmail/src/conf.h b/contrib/sendmail/src/conf.h index b8df01d..c748bf3 100644 --- a/contrib/sendmail/src/conf.h +++ b/contrib/sendmail/src/conf.h @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998 Sendmail, Inc. All rights reserved. + * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers. + * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -9,7 +10,7 @@ * the sendmail distribution. * * - * @(#)conf.h 8.385 (Berkeley) 1/28/1999 + * $Id: conf.h,v 8.496.4.20 2000/07/15 17:35:19 gshapiro Exp $ */ /* $FreeBSD$ */ @@ -21,59 +22,108 @@ ** included in the next release. */ +#ifndef CONF_H +#define CONF_H 1 + #ifdef __GNUC__ struct rusage; /* forward declaration to get gcc to shut up in wait.h */ -#endif +#endif /* __GNUC__ */ # include <sys/param.h> # include <sys/types.h> +# if SFIO && defined(SF_APPEND) +# undef SF_APPEND /* Both sfio/stdio.h and sys/stat.h define it */ +# endif /* SFIO && defined(SF_APPEND) */ # include <sys/stat.h> -#ifndef __QNX__ +# ifndef __QNX__ /* in QNX this grabs bogus LOCK_* manifests */ -# include <sys/file.h> -#endif +# include <sys/file.h> +# endif /* ! __QNX__ */ # include <sys/wait.h> # include <limits.h> # include <fcntl.h> # include <signal.h> # include <netdb.h> # include <pwd.h> +# include <grp.h> + +/* make sure TOBUFSIZ isn't larger than system limit for size of exec() args */ +#ifdef ARG_MAX +# if ARG_MAX > 4096 +# define SM_ARG_MAX 4096 +# else /* ARG_MAX > 4096 */ +# define SM_ARG_MAX ARG_MAX +# endif /* ARG_MAX > 4096 */ +#else /* ARG_MAX */ +# define SM_ARG_MAX 4096 +#endif /* ARG_MAX */ /********************************************************************** ** Table sizes, etc.... ** There shouldn't be much need to change these.... **********************************************************************/ -# define MAXLINE 2048 /* max line length */ -# define MAXNAME 256 /* max length of a name */ -# define MAXPV 40 /* max # of parms to mailers */ -# define MAXATOM 200 /* max atoms per address */ -# define MAXMAILERS 25 /* maximum mailers known to system */ -# define MAXRWSETS 200 /* max # of sets of rewriting rules */ -# define MAXPRIORITIES 25 /* max values for Precedence: field */ -# define MAXMXHOSTS 100 /* max # of MX records for one host */ -# define SMTPLINELIM 990 /* maximum SMTP line length */ -# define MAXKEY 128 /* maximum size of a database key */ -# define MEMCHUNKSIZE 1024 /* chunk size for memory allocation */ -# define MAXUSERENVIRON 100 /* max envars saved, must be >= 3 */ -# define MAXALIASDB 12 /* max # of alias databases */ -# define MAXMAPSTACK 12 /* max # of stacked or sequenced maps */ -# define MAXTOCLASS 8 /* max # of message timeout classes */ -# define MAXMIMEARGS 20 /* max args in Content-Type: */ -# define MAXMIMENESTING 20 /* max MIME multipart nesting */ -# define QUEUESEGSIZE 1000 /* increment for queue size */ -# define MAXQFNAME 20 /* max qf file name length */ -# define MACBUFSIZE 4096 /* max expanded macro buffer size */ -# define TOBUFSIZE 512 /* max buffer to hold address list */ -# define MAXSHORTSTR 203 /* max short string length */ -# if _FFR_MAX_MIME_HEADER_LENGTH -# define MAXMACNAMELEN 25 /* max macro name length */ -# else -# define MAXMACNAMELEN 20 /* max macro name length */ -# endif -# ifndef MAXHDRSLEN -# define MAXHDRSLEN (32 * 1024) /* max size of message headers */ -# endif +#define MAXLINE 2048 /* max line length */ +#define MAXNAME 256 /* max length of a name */ +#define MAXPV 256 /* max # of parms to mailers */ +#define MAXATOM 1000 /* max atoms per address */ +#define MAXRWSETS 200 /* max # of sets of rewriting rules */ +#define MAXPRIORITIES 25 /* max values for Precedence: field */ +#define MAXMXHOSTS 100 /* max # of MX records for one host */ +#define SMTPLINELIM 990 /* maximum SMTP line length */ +#define MAXKEY 128 /* maximum size of a database key */ +#define MEMCHUNKSIZE 1024 /* chunk size for memory allocation */ +#define MAXUSERENVIRON 100 /* max envars saved, must be >= 3 */ +#define MAXALIASDB 12 /* max # of alias databases */ +#define MAXMAPSTACK 12 /* max # of stacked or sequenced maps */ +#if _FFR_MILTER +# define MAXFILTERS 25 /* max # of milter filters */ +# define MAXFILTERMACROS 50 /* max # of macros per milter cmd */ +#endif /* _FFR_MILTER */ +#define MAXSMTPARGS 20 /* max # of ESMTP args for MAIL/RCPT */ +#define MAXTOCLASS 8 /* max # of message timeout classes */ +#define MAXRESTOTYPES 3 /* max # of resolver timeout types */ +#define MAXMIMEARGS 20 /* max args in Content-Type: */ +#define MAXMIMENESTING 20 /* max MIME multipart nesting */ +#define QUEUESEGSIZE 1000 /* increment for queue size */ +#define MAXQFNAME 20 /* max qf file name length */ +#define MACBUFSIZE 4096 /* max expanded macro buffer size */ +#define TOBUFSIZE SM_ARG_MAX /* max buffer to hold address list */ +#define MAXSHORTSTR 203 /* max short string length */ +#define MAXMACNAMELEN 25 /* max macro name length */ +#define MAXMACROID 0377 /* max macro id number */ +#ifndef MAXHDRSLEN +# define MAXHDRSLEN (32 * 1024) /* max size of message headers */ +#endif /* ! MAXHDRSLEN */ +#define MAXDAEMONS 10 /* max number of ports to listen to */ +#ifndef MAXINTERFACES +# define MAXINTERFACES 512 /* number of interfaces to probe */ +#endif /* MAXINTERFACES */ +#ifndef MAXSYMLINKS +# define MAXSYMLINKS 32 /* max number of symlinks in a path */ +#endif /* ! MAXSYMLINKS */ +#define MAXLINKPATHLEN (MAXPATHLEN * MAXSYMLINKS) /* max link-expanded file */ +#define DATA_PROGRESS_TIMEOUT 300 /* how ofter to check DATA progress */ +#define ENHSCLEN 10 /* max len of enhanced status code */ +#if _FFR_DYNAMIC_TOBUF +# define DEFAULT_MAX_RCPT 100 /* max number of RCPTs per envelope */ +#endif /* _FFR_DYNAMIC_TOBUF */ + +#if SASL +# ifndef AUTH_MECHANISMS +# if STARTTLS && _FFR_EXT_MECH +# define AUTH_MECHANISMS "EXTERNAL GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5" +# else /* STARTTLS && _FFR_EXT_MECH */ +# define AUTH_MECHANISMS "GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5" +# endif /* STARTTLS && _FFR_EXT_MECH */ +# endif /* ! AUTH_MECHANISMS */ +#endif /* SASL */ + +#ifdef LDAPMAP +# define LDAPMAP_MAX_ATTR 64 +# define LDAPMAP_MAX_FILTER 1024 +# define LDAPMAP_MAX_PASSWD 256 +#endif /* LDAPMAP */ /********************************************************************** ** Compilation options. @@ -82,41 +132,45 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */ ** All can be overridden from Makefile. **********************************************************************/ -# ifndef NETINET -# define NETINET 1 /* include internet support */ -# endif +#ifndef NETINET +# define NETINET 1 /* include internet support */ +#endif /* ! NETINET */ -# ifndef NETISO -# define NETISO 0 /* do not include ISO socket support */ -# endif +#ifndef NETINET6 +# define NETINET6 0 /* do not include IPv6 support */ +#endif /* ! NETINET6 */ -# ifndef NAMED_BIND -# define NAMED_BIND 1 /* use Berkeley Internet Domain Server */ -# endif +#ifndef NETISO +# define NETISO 0 /* do not include ISO socket support */ +#endif /* ! NETISO */ -# ifndef XDEBUG -# define XDEBUG 1 /* enable extended debugging */ -# endif +#ifndef NAMED_BIND +# define NAMED_BIND 1 /* use Berkeley Internet Domain Server */ +#endif /* ! NAMED_BIND */ -# ifndef MATCHGECOS -# define MATCHGECOS 1 /* match user names from gecos field */ -# endif +#ifndef XDEBUG +# define XDEBUG 1 /* enable extended debugging */ +#endif /* ! XDEBUG */ -# ifndef DSN -# define DSN 1 /* include delivery status notification code */ -# endif +#ifndef MATCHGECOS +# define MATCHGECOS 1 /* match user names from gecos field */ +#endif /* ! MATCHGECOS */ -# if !defined(USERDB) && (defined(NEWDB) || defined(HESIOD)) -# define USERDB 1 /* look in user database */ -# endif +#ifndef DSN +# define DSN 1 /* include delivery status notification code */ +#endif /* ! DSN */ -# ifndef MIME8TO7 -# define MIME8TO7 1 /* 8->7 bit MIME conversions */ -# endif +#if !defined(USERDB) && (defined(NEWDB) || defined(HESIOD)) +# define USERDB 1 /* look in user database */ +#endif /* !defined(USERDB) && (defined(NEWDB) || defined(HESIOD)) */ -# ifndef MIME7TO8 -# define MIME7TO8 1 /* 7->8 bit MIME conversions */ -# endif +#ifndef MIME8TO7 +# define MIME8TO7 1 /* 8->7 bit MIME conversions */ +#endif /* ! MIME8TO7 */ + +#ifndef MIME7TO8 +# define MIME7TO8 1 /* 7->8 bit MIME conversions */ +#endif /* ! MIME7TO8 */ /********************************************************************** ** "Hard" compilation options. @@ -125,7 +179,7 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */ ** be turned off unless absolutely necessary. **********************************************************************/ -# define LOG 1 /* enable logging -- don't turn off */ +#define LOG 1 /* enable logging -- don't turn off */ /********************************************************************** ** End of site-specific configuration. @@ -143,13 +197,15 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */ #ifdef __STDC__ # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ -#endif +#endif /* __STDC__ */ /* ** Assume you have standard calls; can be #undefed below if necessary. */ +#ifndef HASLSTAT # define HASLSTAT 1 /* has lstat(2) call */ +#endif /* ! HASLSTAT */ /********************************************************************** ** Operating system configuration. ** @@ -170,7 +226,7 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */ # define SYSTEM5 1 /* include all the System V defines */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ -# define USESETEUID 1 /* has useable seteuid(2) call */ +# define USESETEUID 1 /* has usable seteuid(2) call */ # define BOGUS_O_EXCL 1 /* exclusive open follows symlinks */ # define seteuid(e) setresuid(-1, e, -1) # define IP_SRCROUTE 1 /* can check IP source routing */ @@ -180,10 +236,18 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */ # define GIDSET_T gid_t # ifndef HASGETUSERSHELL # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ -# endif -# ifndef HPUX11 -# define syslog hard_syslog -# endif +# endif /* ! HASGETUSERSHELL */ +# ifdef HPUX11 +# define HASFCHOWN 1 /* has fchown(2) */ +# define HASSNPRINTF 1 /* has snprintf(3) */ +# ifndef BROKEN_RES_SEARCH +# define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ +# endif /* ! BROKEN_RES_SEARCH */ +# else /* HPUX11 */ +# ifndef NOT_SENDMAIL +# define syslog hard_syslog +# endif /* ! NOT_SENDMAIL */ +# endif /* HPUX11 */ # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */ # ifdef V4FS @@ -191,32 +255,32 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */ # define _PATH_UNIX "/stand/vmunix" # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" -# endif +# endif /* ! _PATH_SENDMAILPID */ # ifndef IDENTPROTO # define IDENTPROTO 1 /* TCP/IP implementation fixed in 10.0 */ -# endif - -# else +# endif /* ! IDENTPROTO */ +# include <sys/mpctl.h> /* for mpctl() in get_num_procs_online() */ +# else /* V4FS */ /* HP-UX 9.x */ # define _PATH_UNIX "/hp-ux" # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ -# endif +# endif /* ! IDENTPROTO */ # ifdef __STDC__ extern void hard_syslog(int, char *, ...); -# else +# else /* __STDC__ */ extern void hard_syslog(); -# endif +# endif /* __STDC__ */ # define FDSET_CAST (int *) /* cast for fd_set parameters to select */ -# endif +# endif /* V4FS */ -#endif +#endif /* __hpux */ /* @@ -225,13 +289,17 @@ extern void hard_syslog(); #ifdef _AIX4 # define _AIX3 1 /* pull in AIX3 stuff */ +# define BSD4_4_SOCKADDR /* has sa_len */ # define USESETEUID 1 /* seteuid(2) works */ # define TZ_TYPE TZ_NAME /* use tzname[] vector */ # define SOCKOPT_LEN_T size_t /* arg#5 to getsockopt */ # if _AIX4 >= 40200 # define HASSETREUID 1 /* setreuid(2) works as of AIX 4.2 */ # define SOCKADDR_LEN_T size_t /* e.g., arg#3 to accept, getsockname */ -# endif +# endif /* _AIX4 >= 40200 */ +# if _AIX4 >= 40300 +# define HASSNPRINTF 1 /* has snprintf starting in 4.3 */ +# endif /* _AIX4 >= 40300 */ # if defined(_ILS_MACROS) /* IBM versions aren't side-effect clean */ # undef isascii # define isascii(c) !(c & ~0177) @@ -239,8 +307,8 @@ extern void hard_syslog(); # define isdigit(__a) (_IS(__a,_ISDIGIT)) # undef isspace # define isspace(__a) (_IS(__a,_ISSPACE)) -# endif -#endif +# endif /* defined(_ILS_MACROS) */ +#endif /* _AIX4 */ /* @@ -251,6 +319,7 @@ extern void hard_syslog(); # include <paths.h> # include <sys/machine.h> /* to get byte order */ # include <sys/select.h> +# define HASFCHOWN 1 /* has fchown(2) */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # define HASUNAME 1 /* use System V uname(2) system call */ # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ @@ -262,7 +331,7 @@ extern void hard_syslog(); # define LA_TYPE LA_INT # define FSHIFT 16 # define LA_AVENRUN "avenrun" -#endif +#endif /* _AIX3 */ /* @@ -303,11 +372,11 @@ typedef int pid_t; /* make this sendmail in a completely different place */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/local/newmail/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/usr/local/newmail/sendmail.pid" -# endif -#endif +# endif /* ! _PATH_SENDMAILPID */ +#endif /* AIX */ /* @@ -317,9 +386,9 @@ typedef int pid_t; ** ** Use IRIX64 instead of IRIX for 64-bit IRIX (6.0). ** Use IRIX5 instead of IRIX for IRIX 5.x. -** +** ** This version tries to be adaptive using _MIPS_SIM: -** _MIPS_SIM == _ABIO32 (= 1) Abi: -32 on IRIX 6.2 +** _MIPS_SIM == _ABIO32 (= 1) Abi: -32 on IRIX 6.2 ** _MIPS_SIM == _ABIN32 (= 2) Abi: -n32 on IRIX 6.2 ** _MIPS_SIM == _ABI64 (= 3) Abi: -64 on IRIX 6.2 ** @@ -333,15 +402,14 @@ typedef int pid_t; #if defined(__sgi) # ifndef IRIX # define IRIX -# endif +# endif /* ! IRIX */ # if _MIPS_SIM > 0 && !defined(IRIX5) # define IRIX5 /* IRIX5 or IRIX6 */ -# endif +# endif /* _MIPS_SIM > 0 && !defined(IRIX5) */ # if _MIPS_SIM > 1 && !defined(IRIX6) && !defined(IRIX64) # define IRIX6 /* IRIX6 */ -# endif - -#endif +# endif /* _MIPS_SIM > 1 && !defined(IRIX6) && !defined(IRIX64) */ +#endif /* defined(__sgi) */ #ifdef IRIX # define SYSTEM5 1 /* this is a System-V derived system */ @@ -356,34 +424,35 @@ typedef int pid_t; # define SFS_BAVAIL f_bfree /* alternate field name */ # define SYSLOG_BUFSIZE 512 # ifdef IRIX6 -# define STAT64 1 +# define STAT64 1 # define QUAD_T unsigned long long # define LA_TYPE LA_IRIX6 /* figure out at run time */ # define SAFENFSPATHCONF 0 /* pathconf(2) lies on NFS filesystems */ -# else +# else /* IRIX6 */ # define LA_TYPE LA_INT # ifdef IRIX64 -# define STAT64 1 +# define STAT64 1 # define QUAD_T unsigned long long # define NAMELISTMASK 0x7fffffffffffffff /* mask for nlist() values */ -# else -# define STAT64 0 +# else /* IRIX64 */ +# define STAT64 0 # define NAMELISTMASK 0x7fffffff /* mask for nlist() values */ -# endif -# endif +# endif /* IRIX64 */ +# endif /* IRIX6 */ # if defined(IRIX64) || defined(IRIX5) || defined(IRIX6) # include <sys/cdefs.h> # include <paths.h> # define ARGV_T char *const * +# define HASFCHOWN 1 /* has fchown(2) */ # define HASSETRLIMIT 1 /* has setrlimit(2) syscall */ -# define HASGETDTABLESIZE 1 /* has getdtablesize(2) syscall */ +# define HASGETDTABLESIZE 1 /* has getdtablesize(2) syscall */ # define HASSTRERROR 1 /* has strerror(3) */ -# else +# else /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */ # define ARGV_T const char ** # define WAITUNION 1 /* use "union wait" as wait argument type */ -# endif -#endif +# endif /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */ +#endif /* IRIX */ /* @@ -401,78 +470,95 @@ typedef int pid_t; # define HASFCHMOD 1 /* has fchmod(2) syscall */ # define IP_SRCROUTE 1 /* can check IP source routing */ # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */ +# ifndef HASFCHOWN +# define HASFCHOWN 1 /* fchown(2) */ +# endif /* ! HASFCHOWN */ # ifdef SOLARIS_2_3 # define SOLARIS 20300 /* for back compat only -- use -DSOLARIS=20300 */ -# endif +# endif /* SOLARIS_2_3 */ # if defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4)) # define SOLARIS 1 /* unknown Solaris version */ -# endif +# endif /* defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4)) */ # ifdef SOLARIS /* Solaris 2.x (a.k.a. SunOS 5.x) */ # ifndef __svr4__ -# define __svr4__ /* use all System V Releae 4 defines below */ -# endif +# define __svr4__ /* use all System V Release 4 defines below */ +# endif /* ! __svr4__ */ # define GIDSET_T gid_t # define USE_SA_SIGACTION 1 /* use sa_sigaction field */ # ifndef _PATH_UNIX # define _PATH_UNIX "/dev/ksyms" -# endif +# endif /* ! _PATH_UNIX */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" -# endif +# endif /* ! _PATH_SENDMAILPID */ # ifndef _PATH_HOSTS # define _PATH_HOSTS "/etc/inet/hosts" -# endif +# endif /* ! _PATH_HOSTS */ # ifndef SYSLOG_BUFSIZE # define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */ -# endif +# endif /* ! SYSLOG_BUFSIZE */ # ifndef TZ_TYPE # define TZ_TYPE TZ_TZNAME -# endif +# endif /* ! TZ_TYPE */ # if SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203) # define USESETEUID 1 /* seteuid works as of 2.3 */ -# endif +# endif /* SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203) */ # if SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) # define HASSETREUID 1 /* setreuid works as of 2.5 */ # if SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700) # ifndef LA_TYPE # define LA_TYPE LA_KSTAT /* use kstat(3k) -- may work in < 2.5 */ -# endif -# endif -# endif +# endif /* ! LA_TYPE */ +# ifndef RANDOMSHIFT /* random() doesn't work well (sometimes) */ +# define RANDOMSHIFT 8 +# endif /* RANDOMSHIFT */ +# endif /* SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700) */ +# else /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */ +# ifndef HASRANDOM +# define HASRANDOM 0 /* doesn't have random(3) */ +# endif /* ! HASRANDOM */ +# endif /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */ # if SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) # define HASSNPRINTF 1 /* has snprintf starting in 2.6 */ -# endif +# endif /* SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) */ # if SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) # ifndef LA_TYPE +# include <sys/loadavg.h> # define LA_TYPE LA_SUBR /* getloadavg(3c) appears in 2.7 */ -# endif +# endif /* ! LA_TYPE */ # define HASGETUSERSHELL 1 /* getusershell(3c) bug fixed in 2.7 */ -# endif +# endif /* SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) */ +# if SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) +# undef NETINET6 +# define NETINET6 1 /* IPv6 added in 2.8 */ +# define HASSTRL 1 /* str*(3) added in 2.8 */ +# endif /* SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) */ # ifndef HASGETUSERSHELL # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps pre-2.7 */ -# endif +# endif /* ! HASGETUSERSHELL */ -# else +# else /* SOLARIS */ /* SunOS 4.0.3 or 4.1.x */ # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ # define HASSETREUID 1 /* has setreuid(2) call */ # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ -# endif +# endif /* ! HASFLOCK */ # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */ # include <memory.h> # include <vfork.h> # ifdef __GNUC__ # define strtoul strtol /* gcc library bogosity */ -# endif +# endif /* __GNUC__ */ +# define memmove(d, s, l) (bcopy((s), (d), (l))) # ifdef SUNOS403 /* special tweaking for SunOS 4.0.3 */ @@ -488,19 +574,19 @@ typedef int pid_t; typedef int pid_t; extern char *getenv(); -# else +# else /* SUNOS403 */ /* 4.1.x specifics */ # define HASSETSID 1 /* has Posix setsid(2) call */ # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ -# endif -# endif +# endif /* SUNOS403 */ +# endif /* SOLARIS */ # ifndef LA_TYPE # define LA_TYPE LA_INT -# endif +# endif /* ! LA_TYPE */ -#endif /* sun && !BSD */ +#endif /* defined(sun) && !defined(BSD) */ /* ** DG/UX @@ -512,9 +598,9 @@ extern char *getenv(); #ifdef DGUX_5_4_2 # define DGUX 1 -#endif +#endif /* DGUX_5_4_2 */ -#ifdef DGUX +#ifdef DGUX # define SYSTEM5 1 # define LA_TYPE LA_DGUX # define HASSETREUID 1 /* has setreuid(2) call */ @@ -526,7 +612,7 @@ extern char *getenv(); # define HASSNPRINTF 1 /* has snprintf(3) */ # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ -# endif +# endif /* ! IDENTPROTO */ # define SPT_TYPE SPT_NONE /* don't use setproctitle */ # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ @@ -540,8 +626,8 @@ extern char *getenv(); # ifdef DGUX_5_4_2 # define inet_addr dgux_inet_addr extern long dgux_inet_addr(); -# endif -#endif +# endif /* DGUX_5_4_2 */ +#endif /* DGUX */ /* @@ -558,39 +644,43 @@ extern long dgux_inet_addr(); # define HASINITGROUPS 1 /* has initgroups(3) call */ # define HASUNAME 1 /* use System V uname(2) system call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ +# define HASFCHOWN 1 /* has fchown(2) syscall */ # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ -# endif +# endif /* ! HASFLOCK */ # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ # ifndef BROKEN_RES_SEARCH # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ -# endif +# endif /* ! BROKEN_RES_SEARCH */ +# if !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621 +# define NEEDLOCAL_HOSTNAME_LENGTH 1 /* see sendmail/README */ +# endif /* !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621 */ # ifdef vax # define LA_TYPE LA_FLOAT -# else +# else /* vax */ # define LA_TYPE LA_INT # define LA_AVENRUN "avenrun" -# endif +# endif /* vax */ # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ # ifndef IDENTPROTO # define IDENTPROTO 0 /* pre-4.4 TCP/IP implementation is broken */ -# endif +# endif /* ! IDENTPROTO */ # define SYSLOG_BUFSIZE 256 -#endif +#endif /* ultrix */ /* ** OSF/1 for KSR. ** -** Contributed by Todd C. Miller <Todd.Miller@cs.colorado.edu> +** Contributed by Todd C. Miller <Todd.Miller@cs.colorado.edu> */ #ifdef __ksr__ -# define __osf__ 1 /* get OSF/1 defines below */ +# define __osf__ 1 /* get OSF/1 defines below */ # ifndef TZ_TYPE # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ -# endif -#endif +# endif /* ! TZ_TYPE */ +#endif /* __ksr__ */ /* @@ -604,40 +694,44 @@ extern long dgux_inet_addr(); # define __osf__ 1 /* get OSF/1 defines below */ # ifndef TZ_TYPE # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ -# endif +# endif /* ! TZ_TYPE */ # define GIDSET_T gid_t # define MAXNAMLEN NAME_MAX -#endif +#endif /* __PARAGON__ */ /* -** OSF/1 (tested on Alpha) -- now known as Digital UNIX. +** Tru64 UNIX, formerly known as Digital UNIX, formerly known as DEC OSF/1 ** ** Tested for 3.2 and 4.0. */ #ifdef __osf__ +# define HASUNAME 1 /* has uname(2) call */ # define HASUNSETENV 1 /* has unsetenv(3) call */ -# define USESETEUID 1 /* has useable seteuid(2) call */ +# define USESETEUID 1 /* has usable seteuid(2) call */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ +# define HASFCHOWN 1 /* has fchown(2) syscall */ +# define HASSETLOGIN 1 /* has setlogin(2) */ # define IP_SRCROUTE 1 /* can check IP source routing */ # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ +# define GIDSET_T gid_t +# if _FFR_MILTER +# define SM_INT32 int /* 32bit integer */ +# endif /* _FFR_MILTER */ # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ -# endif +# endif /* ! HASFLOCK */ # define LA_TYPE LA_ALPHAOSF # define SFS_TYPE SFS_STATVFS /* use <sys/statvfs.h> statfs() impl */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/var/adm/sendmail/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/var/run/sendmail.pid" -# endif -# define bcopy(s, d, l) (memmove((d), (s), (l))) -# define bzero(d, l) (memset((d), '\0', (l))) -# define bcmp(s, d, l) (memcmp((s), (d), (l))) -#endif +# endif /* ! _PATH_SENDMAILPID */ +#endif /* __osf__ */ /* @@ -649,7 +743,7 @@ extern long dgux_inet_addr(); # define NEEDPUTENV 2 /* need putenv(3) call; no setenv(3) call */ # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ -# endif +# endif /* ! HASFLOCK */ # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ # define WAITUNION 1 /* use "union wait" as wait argument type */ # define UID_T int /* compiler gripes on uid_t */ @@ -658,38 +752,42 @@ extern long dgux_inet_addr(); # define setpgid setpgrp # ifndef NOT_SENDMAIL # define sleep sleepX -# endif +# endif /* ! NOT_SENDMAIL */ # ifndef LA_TYPE # define LA_TYPE LA_MACH -# endif +# endif /* ! LA_TYPE */ # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ # ifndef _POSIX_SOURCE typedef int pid_t; # undef WEXITSTATUS # undef WIFEXITED -# endif +# undef WIFSTOPPED +# undef WTERMSIG +# endif /* ! _POSIX_SOURCE */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/etc/sendmail/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid" -# endif +# endif /* ! _PATH_SENDMAILPID */ # ifdef TCPWRAPPERS # ifndef HASUNSETENV # define HASUNSETENV 1 -# endif +# endif /* ! HASUNSETENV */ # undef NEEDPUTENV -# endif +# endif /* TCPWRAPPERS */ -#endif +#endif /* NeXT */ /* ** Apple Rhapsody ** Contributed by Wilfredo Sanchez <wsanchez@apple.com> +** +** Also used for Apple Darwin support. */ -#ifdef __APPLE__ +#if defined(DARWIN) # define HASFCHMOD 1 /* has fchmod(2) syscall */ # define HASFLOCK 1 /* has flock(2) syscall */ # define HASUNAME 1 /* has uname(2) syscall */ @@ -698,13 +796,13 @@ typedef int pid_t; # define HASINITGROUPS 1 # define HASSETVBUF 1 # define HASSETREUID 1 -# define USESETEUID 1 /* has useable seteuid(2) call */ +# define USESETEUID 1 /* has usable seteuid(2) call */ # define HASLSTAT 1 # define HASSETRLIMIT 1 # define HASWAITPID 1 # define HASSTRERROR 1 /* has strerror(3) */ # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ -# define USESTRERROR 1 /* has strerror(3) */ +# define HASSTRERROR 1 /* has strerror(3) */ # define HASGETDTABLESIZE 1 # define HASGETUSERSHELL 1 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ @@ -717,7 +815,7 @@ typedef int pid_t; # define SPT_TYPE SPT_PSSTRINGS # define SPT_PADCHAR '\0' /* pad process title with nulls */ # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ -#endif +#endif /* DARWIN */ /* @@ -729,7 +827,7 @@ typedef int pid_t; #if defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) # include <paths.h> # define HASUNSETENV 1 /* has unsetenv(3) call */ -# define USESETEUID 1 /* has useable seteuid(2) call */ +# define USESETEUID 1 /* has usable seteuid(2) call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ # define HASSTRERROR 1 /* has strerror(3) */ @@ -741,10 +839,10 @@ typedef int pid_t; # define NETLINK 1 /* supports AF_LINK */ # ifndef LA_TYPE # define LA_TYPE LA_SUBR -# endif +# endif /* ! LA_TYPE */ # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ # define SPT_TYPE SPT_PSSTRINGS /* use PS_STRINGS pointer */ -#endif +#endif /* defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) */ /* @@ -756,8 +854,9 @@ typedef int pid_t; # include <paths.h> # define HASUNSETENV 1 /* has the unsetenv(3) call */ # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ -# define USESETEUID 1 /* has useable seteuid(2) call */ +# define USESETEUID 1 /* has usable seteuid(2) call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ +# define HASSETLOGIN 1 /* has setlogin(2) */ # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ # define HASUNAME 1 /* has uname(2) syscall */ # define HASSTRERROR 1 /* has strerror(3) */ @@ -769,21 +868,21 @@ typedef int pid_t; # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ # ifndef LA_TYPE # define LA_TYPE LA_SUBR -# endif +# endif /* ! LA_TYPE */ # define GIDSET_T gid_t # define QUAD_T quad_t # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 /* version 1.1 or later */ # undef SPT_TYPE # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ -# else +# else /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */ /* version 1.0 or earlier */ # define SPT_PADCHAR '\0' /* pad process title with nulls */ -# endif +# endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */ # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 /* on 3.x */ # define HASSETUSERCONTEXT 1 /* has setusercontext */ -# endif -#endif +# endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 */ +#endif /* __bsdi__ */ /* @@ -797,29 +896,26 @@ typedef int pid_t; # include <unix.h> # include <sys/select.h> # undef NGROUPS_MAX -# define HASSETSID 1 /* has the setsid(2) POSIX syscall */ -# define USESETEUID 1 /* has useable seteuid(2) call */ -# define HASFCHMOD 1 /* has fchmod(2) syscall */ -# define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ -# define HASSETREUID 1 /* has setreuid(2) call */ +# define HASSETSID 1 /* has the setsid(2) POSIX syscall */ +# define USESETEUID 1 /* has usable seteuid(2) call */ +# define HASFCHMOD 1 /* has fchmod(2) syscall */ +# define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ +# define HASSETREUID 1 /* has setreuid(2) call */ # define HASSTRERROR 1 /* has strerror(3) */ # define HASFLOCK 0 -# undef HASINITGROUPS /* has initgroups(3) call */ -# define NEEDGETOPT 1 /* use sendmail's getopt */ -# define IP_SRCROUTE 1 /* can check IP source routing */ -# define TZ_TYPE TZ_TMNAME /* use tmname variable */ -# define GIDSET_T gid_t -# define LA_TYPE LA_ZERO -# define SFS_TYPE SFS_NONE -# define SPT_TYPE SPT_REUSEARGV -# define SPT_PADCHAR '\0' /* pad process title with nulls */ +# undef HASINITGROUPS /* has initgroups(3) call */ +# define NEEDGETOPT 1 /* use sendmail's getopt */ +# define IP_SRCROUTE 1 /* can check IP source routing */ +# define TZ_TYPE TZ_TMNAME /* use tmname variable */ +# define GIDSET_T gid_t +# define LA_TYPE LA_ZERO +# define SFS_TYPE SFS_NONE +# define SPT_TYPE SPT_REUSEARGV +# define SPT_PADCHAR '\0' /* pad process title with nulls */ # define HASGETUSERSHELL 0 # define E_PSEUDOBASE 512 -# define bcopy(s, d, l) (memmove((d), (s), (l))) -# define bzero(d, l) (memset((d), '\0', (l))) -# define bcmp(s, d, l) (memcmp((s), (d), (l))) # define _FILE_H_INCLUDED -#endif +#endif /* defined(__QNX__) */ /* @@ -833,14 +929,11 @@ typedef int pid_t; #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) # include <paths.h> -# if defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) -# define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" -# define USE_VENDOR_CF_PATH -# endif # define HASUNSETENV 1 /* has unsetenv(3) call */ # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ -# define USESETEUID 1 /* has useable seteuid(2) call */ +# define USESETEUID 1 /* has usable seteuid(2) call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ +# define HASFCHOWN 1 /* fchown(2) */ # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ # define HASUNAME 1 /* has uname(2) syscall */ # define HASSTRERROR 1 /* has strerror(3) */ @@ -853,37 +946,59 @@ typedef int pid_t; # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */ # define GIDSET_T gid_t # define QUAD_T unsigned long long +# define SFIO_STDIO_COMPAT 1 /* can use RES_DEBUG */ # ifndef LA_TYPE # define LA_TYPE LA_SUBR -# endif +# endif /* ! LA_TYPE */ # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ # if defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1) # undef SPT_TYPE # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ -# endif +# endif /* defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1) */ +# if defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3)) +# define HASURANDOMDEV 1 /* has /dev/urandom(4) */ +# endif /* defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3)) */ # if defined(__FreeBSD__) +# define HASSETLOGIN 1 /* has setlogin(2) */ +# if __FreeBSD_version >= 227001 +# define HASSRANDOMDEV 1 /* has srandomdev(3) */ +# define HASURANDOMDEV 1 /* has /dev/urandom(4) */ +# endif /* __FreeBSD_version >= 227001 */ # undef SPT_TYPE # if __FreeBSD__ >= 2 # include <osreldate.h> # if __FreeBSD_version >= 199512 /* 2.2-current when it appeared */ # include <libutil.h> # define SPT_TYPE SPT_BUILTIN -# endif +# endif /* __FreeBSD_version >= 199512 */ # if __FreeBSD_version >= 222000 /* 2.2.2-release and later */ -# define HASSETUSERCONTEXT 1 /* BSDI-style login classes */ -# endif -# endif +# define HASSETUSERCONTEXT 1 /* BSDI-style login classes */ +# endif /* __FreeBSD_version >= 222000 */ +# if __FreeBSD_version >= 330000 /* 3.3.0-release and later */ +# ifndef HASSTRL +# define HASSTRL 1 /* has strlc{py,at}(3) functions */ +# endif /* HASSTRL */ +# endif /* __FreeBSD_version >= 330000 */ +# define USESYSCTL 1 /* use sysctl(3) for getting ncpus */ +# include <sys/sysctl.h> +# endif /* __FreeBSD__ >= 2 */ # ifndef SPT_TYPE # define SPT_TYPE SPT_REUSEARGV # define SPT_PADCHAR '\0' /* pad process title with nulls */ -# endif -# endif +# endif /* ! SPT_TYPE */ +# endif /* defined(__FreeBSD__) */ # if defined(__OpenBSD__) # undef SPT_TYPE # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ -# endif -#endif - +# define HASSETLOGIN 1 /* has setlogin(2) */ +# define HASURANDOMDEV 1 /* has /dev/urandom(4) */ +# if OpenBSD < 199912 +# define HASSTRL 0 /* strlcat(3) is broken in 2.5 and earlier */ +# else /* OpenBSD < 199912 */ +# define HASSTRL 1 /* has strlc{py,at}(3) functions */ +# endif /* OpenBSD < 199912 */ +# endif /* defined(__OpenBSD__) */ +#endif /* defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */ /* @@ -898,24 +1013,24 @@ typedef int pid_t; # define HASINITGROUPS 1 /* has initgroups(3) call */ # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ -# endif +# endif /* ! HASFLOCK */ # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ # define NEEDSTRTOL 1 /* need the strtol() function */ # define setpgid setpgrp # ifndef LA_TYPE # define LA_TYPE LA_FLOAT -# endif +# endif /* ! LA_TYPE */ # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ # undef HASSETVBUF /* don't actually have setvbuf(3) */ # undef WEXITSTATUS # undef WIFEXITED # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/sendmail.pid" -# endif -#endif +# endif /* ! _PATH_SENDMAILPID */ +#endif /* defined(MACH) && defined(i386) && !defined(__GNU__) */ @@ -923,44 +1038,37 @@ typedef int pid_t; ** GNU OS (hurd) ** Largely BSD & posix compatible. ** Port contributed by Miles Bader <miles@gnu.ai.mit.edu>. +** Updated by Mark Kettenis <kettenis@wins.uva.nl>. */ -#ifdef __GNU_HURD__ -# define SIOCGIFCONF_IS_BROKEN 1 -# define IP_SRCROUTE 0 -# define HASFCHMOD 1 -# define HASFLOCK 1 -# define HASUNAME 1 -# define HASUNSETENV 1 -# define HASSETSID 1 -# define HASINITGROUPS 1 -# define HASSETVBUF 1 -# define HASSETREUID 1 -# define USESETEUID 1 -# define HASLSTAT 1 -# define HASSETRLIMIT 1 -# define HASWAITPID 1 -# define HASGETDTABLESIZE 1 -# define HASSTRERROR 1 -/* # define NEEDGETOPT 1 */ -# define HASGETUSERSHELL 1 -# define ERRLIST_PREDEFINED 1 -# define BSD4_4_SOCKADDR 1 +#if defined(__GNU__) && !defined(NeXT) +# include <paths.h> +# define HASFCHMOD 1 /* has fchmod(2) call */ +# define HASFCHOWN 1 /* has fchown(2) call */ +# define HASUNAME 1 /* has uname(2) call */ +# define HASUNSETENV 1 /* has unsetenv(3) call */ +# define HAS_ST_GEN 1 /* has st_gen field in stat struct */ +# define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ +# define HASSTRERROR 1 /* has strerror(3) */ # define GIDSET_T gid_t -# define LA_TYPE LA_MACH - -/* GNU uses mach[34], which renames some rpcs from mach2.x. */ -# define host_self mach_host_self +# define SOCKADDR_LEN_T socklen_t +# define SOCKOPT_LEN_T socklen_t +# if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 +# define LA_TYPE LA_SUBR +# else +# define LA_TYPE LA_MACH + /* GNU uses mach[34], which renames some rpcs from mach2.x. */ +# define host_self mach_host_self +# endif # define SFS_TYPE SFS_STATFS # define SPT_TYPE SPT_CHANGEARGV - -/* GNU has no MAXPATHLEN; ideally the code should be changed to not use it. */ +# define ERRLIST_PREDEFINED 1 /* don't declare sys_errlist */ +# define BSD4_4_SOCKADDR 1 /* has sa_len */ +# define SIOCGIFCONF_IS_BROKEN 1 /* SIOCGFCONF doesn't work */ +# define HAS_IN_H 1 /* GNU has netinet/in.h. */ +/* GNU has no MAXPATHLEN; ideally the code should be changed to not use it. */ # define MAXPATHLEN 2048 - -/* Define device num frobbing macros. */ -# define major(x) ((x)>>8) -# define minor(x) ((x)&0xFF) -#endif /* GNU */ +#endif /* defined(__GNU__) && !defined(NeXT) */ /* ** 4.3 BSD -- this is for very old systems @@ -978,18 +1086,17 @@ typedef int pid_t; # define setpgid setpgrp # ifndef LA_TYPE # define LA_TYPE LA_FLOAT -# endif +# endif /* ! LA_TYPE */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ -# endif +# endif /* ! IDENTPROTO */ # undef WEXITSTATUS # undef WIFEXITED typedef short pid_t; -extern int errno; -#endif +#endif /* defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) */ /* @@ -1016,6 +1123,7 @@ extern int errno; # define SIOCGIFNUM_IS_BROKEN 1 /* SIOCGIFNUM returns bogus value */ # define HASSNPRINTF 1 /* has snprintf(3) call */ # define HASFCHMOD 1 /* has fchmod(2) call */ +# define HASFCHOWN 1 /* has fchown(2) call */ # define HASSETRLIMIT 1 /* has setrlimit(2) call */ # define USESETEUID 1 /* has seteuid(2) call */ # define HASINITGROUPS 1 /* has initgroups(3) call */ @@ -1023,21 +1131,21 @@ extern int errno; # define RLIMIT_NEEDS_SYS_TIME_H 1 # ifndef LA_TYPE # define LA_TYPE LA_DEVSHORT -# endif +# endif /* ! LA_TYPE */ # define _PATH_AVENRUN "/dev/table/avenrun" # ifndef _SCO_unix_4_2 # define _SCO_unix_4_2 -# else +# else /* ! _SCO_unix_4_2 */ # define SOCKADDR_LEN_T size_t /* e.g., arg#3 to accept, getsockname */ # define SOCKOPT_LEN_T size_t /* arg#5 to getsockopt */ -# endif -#endif +# endif /* ! _SCO_unix_4_2 */ +#endif /* _SCO_DS >= 1 */ /* SCO UNIX 3.2v4.2/Open Desktop 3.0 */ #ifdef _SCO_unix_4_2 # define _SCO_unix_ # define HASSETREUID 1 /* has setreuid(2) call */ -#endif +#endif /* _SCO_unix_4_2 */ /* SCO UNIX 3.2v4.0 Open Desktop 2.0 and earlier */ #ifdef _SCO_unix_ @@ -1057,24 +1165,24 @@ extern int errno; # define _PATH_UNIX "/unix" # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/sendmail.pid" -# endif +# endif /* ! _PATH_SENDMAILPID */ /* stuff fixed in later releases */ # ifndef _SCO_unix_4_2 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ -# endif +# endif /* ! _SCO_unix_4_2 */ # ifndef _SCO_DS # define ftruncate chsize /* use chsize(2) to emulate ftruncate */ # define NEEDFSYNC 1 /* needs the fsync(2) call stub */ # define NETUNIX 0 /* no unix domain socket support */ # define LA_TYPE LA_SHORT -# endif +# endif /* ! _SCO_DS */ -#endif +#endif /* _SCO_unix_ */ /* @@ -1100,12 +1208,11 @@ extern int errno; # define _PATH_UNIX "/unix" # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/sendmail.pid" -# endif - -#endif +# endif /* ! _PATH_SENDMAILPID */ +#endif /* ISC_UNIX */ /* @@ -1139,7 +1246,6 @@ typedef short pid_t; typedef unsigned long mode_t; /* some stuff that should have been in the include files */ -# include <grp.h> extern char *malloc(); extern struct passwd *getpwent(); extern struct passwd *getpwnam(); @@ -1148,7 +1254,7 @@ extern char *getenv(); extern struct group *getgrgid(); extern struct group *getgrnam(); -#endif +#endif /* ALTOS_SYSTEM_V */ /* @@ -1181,7 +1287,7 @@ extern struct group *getgrnam(); # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef S_IREAD # define S_IREAD _S_IREAD # define S_IWRITE _S_IWRITE @@ -1189,26 +1295,26 @@ extern struct group *getgrnam(); # define S_IFMT _S_IFMT # define S_IFCHR _S_IFCHR # define S_IFBLK _S_IFBLK -# endif +# endif /* ! S_IREAD */ # ifndef TZ_TYPE # define TZ_TYPE TZ_TIMEZONE -# endif +# endif /* ! TZ_TYPE */ # ifndef IDENTPROTO # define IDENTPROTO 1 -# endif +# endif /* ! IDENTPROTO */ # ifndef SHARE_V1 # define SHARE_V1 1 /* version 1 of the fair share scheduler */ -# endif +# endif /* ! SHARE_V1 */ # if !defined(__GNUC__ ) # define UID_T int /* GNUC gets it right, ConvexC botches */ # define GID_T int /* GNUC gets it right, ConvexC botches */ -# endif +# endif /* !defined(__GNUC__ ) */ # if SECUREWARE # define FORK fork /* SecureWare wants the real fork! */ -# else +# else /* SECUREWARE */ # define FORK vfork /* the rest of the OS versions don't care */ -# endif -#endif +# endif /* SECUREWARE */ +#endif /* _CONVEX_SOURCE */ /* @@ -1222,7 +1328,7 @@ extern struct group *getgrnam(); # define HASUNSETENV 1 /* has unsetenv(3) call */ # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ -# endif +# endif /* ! HASFLOCK */ # define WAITUNION 1 /* use "union wait" as wait argument type */ # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ # define NEEDPUTENV 1 /* need putenv(3) call */ @@ -1235,7 +1341,6 @@ extern struct group *getgrnam(); # define setpgid setpgrp -extern int errno; typedef int pid_t; # define SIGFUNC_DEFINED # define SIGFUNC_RETURN (0) @@ -1248,14 +1353,14 @@ extern void *malloc(); # ifdef RISCOS_4_0 # ifndef ARBPTR_T # define ARBPTR_T char * -# endif +# endif /* ! ARBPTR_T */ # undef HASFLOCK # define HASFLOCK 0 # endif /* RISCOS_4_0 */ # include <sys/time.h> -#endif +#endif /* RISCOS */ /* @@ -1273,12 +1378,16 @@ extern void *malloc(); ** gcc-2.8.1 glibc-2.0.94 linux-2.1.109 ** ** NOTE: Override HASFLOCK as you will but, as of 1.99.6, mixed-style -** file locking is no longer allowed. In particular, make sure +** file locking is no longer allowed. In particular, make sure ** your DBM library and sendmail are both using either flock(2) ** *or* fcntl(2) file locking, but not both. */ #ifdef __linux__ +# include <linux/version.h> +# if !defined(KERNEL_VERSION) /* not defined in 2.0.x kernel series */ +# define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) +# endif /* KERNEL_VERSION */ # define BSD 1 /* include BSD defines */ # define USESETEUID 0 /* Have it due to POSIX, but doesn't work */ # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ @@ -1286,34 +1395,73 @@ extern void *malloc(); # define HASUNSETENV 1 /* has unsetenv(3) call */ # ifndef HASSNPRINTF # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ -# endif +# endif /* ! HASSNPRINTF */ # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ # define GIDSET_T gid_t /* from <linux/types.h> */ # define HASGETUSERSHELL 0 /* getusershell(3) broken in Slackware 2.0 */ -# define IP_SRCROUTE 0 /* linux <= 1.2.8 doesn't support IP_OPTIONS */ +# ifndef IP_SRCROUTE +# define IP_SRCROUTE 0 /* linux <= 1.2.8 doesn't support IP_OPTIONS */ +# endif /* ! IP_SRCROUTE */ +# ifndef HAS_IN_H +# define HAS_IN_H 1 /* use netinet/in.h */ +# endif /* ! HAS_IN_H */ # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */ # ifndef HASFLOCK -# include <linux/version.h> # if LINUX_VERSION_CODE < 66399 # define HASFLOCK 0 /* flock(2) is broken after 0.99.13 */ -# else +# else /* LINUX_VERSION_CODE < 66399 */ # define HASFLOCK 1 /* flock(2) fixed after 1.3.95 */ -# endif -# endif +# endif /* LINUX_VERSION_CODE < 66399 */ +# endif /* ! HASFLOCK */ # ifndef LA_TYPE # define LA_TYPE LA_PROCSTR -# endif +# endif /* ! LA_TYPE */ # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() impl */ # define SPT_PADCHAR '\0' /* pad process title with nulls */ +# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0)) +# ifndef HASURANDOMDEV +# define HASURANDOMDEV 1 /* 2.0 (at least) has linux/drivers/char/random.c */ +# endif /* ! HASURANDOMDEV */ +# endif /* LINUX_VERSION_CODE */ # ifndef TZ_TYPE # define TZ_TYPE TZ_NONE /* no standard for Linux */ -# endif +# endif /* ! TZ_TYPE */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/var/run/sendmail.pid" -# endif +# endif /* ! _PATH_SENDMAILPID */ # include <sys/sysmacros.h> # undef atol /* wounded in <stdlib.h> */ -#endif +# if NETINET6 + /* + ** Linux doesn't have a good way to tell userland what interfaces are + ** IPv6-capable. Therefore, the BIND resolver can not determine if there + ** are IPv6 interfaces to honor AI_ADDRCONFIG. Unfortunately, it assumes + ** that none are present. (Excuse the macro name ADDRCONFIG_IS_BROKEN.) + */ +# define ADDRCONFIG_IS_BROKEN 1 + + /* + ** Indirectly included from glibc's <feature.h>. IPv6 support is native + ** in 2.1 and later, but the APIs appear before the functions. + */ +# if defined(__GLIBC__) && defined(__GLIBC_MINOR__) +# define GLIBC_VERSION ((__GLIBC__ << 8) + __GLIBC_MINOR__) +# if (GLIBC_VERSION >= 0x201) +# undef IPPROTO_ICMPV6 /* linux #defines, glibc enums */ +# else /* (GLIBC_VERSION >= 0x201) */ +# include <linux/in6.h> /* IPv6 support */ +# endif /* (GLIBC_VERSION >= 0x201) */ +# if (GLIBC_VERSION == 0x201 && !defined(NEEDSGETIPNODE)) + /* Have APIs in <netdb.h>, but no support in glibc */ +# define NEEDSGETIPNODE 1 +# endif /* (GLIBC_VERSION == 0x201 && ! NEEDSGETIPNODE) */ +# undef GLIBC_VERSION +# endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */ +# endif /* NETINET6 */ +# ifndef HASFCHOWN +# define HASFCHOWN 1 /* fchown(2) */ +# endif /* ! HASFCHOWN */ +#endif /* __linux__ */ /* @@ -1331,7 +1479,7 @@ extern void *malloc(); #ifdef DELL_SVR4 /* no changes necessary */ /* see general __svr4__ defines below */ -#endif +#endif /* DELL_SVR4 */ /* @@ -1355,23 +1503,23 @@ extern void *malloc(); # define ERRLIST_PREDEFINED 1 # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ -# endif +# endif /* ! IDENTPROTO */ # ifndef LA_TYPE # define LA_TYPE LA_INT # define FSHIFT 16 -# endif +# endif /* ! LA_TYPE */ # define LA_AVENRUN "avenrun" # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ # define TZ_TYPE TZ_TZNAME # ifndef _PATH_UNIX # define _PATH_UNIX "/unix" /* should be in <paths.h> */ -# endif +# endif /* ! _PATH_UNIX */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # undef WIFEXITED # undef WEXITSTATUS -#endif +#endif /* _AUX_SOURCE */ /* @@ -1393,7 +1541,7 @@ extern struct passwd *getpwent(), *getpwnam(), *getpwuid(); extern struct group *getgrent(), *getgrnam(), *getgrgid(); # undef WIFEXITED # undef WEXITSTATUS -#endif +#endif /* UMAXV */ /* @@ -1411,7 +1559,7 @@ extern struct group *getgrent(), *getgrnam(), *getgrgid(); typedef int pid_t; # undef WIFEXITED # undef WEXITSTATUS -#endif +#endif /* titan */ /* @@ -1427,9 +1575,9 @@ typedef int pid_t; # define BSD4_3 1 /* to get signal() in conf.c */ # define WAITUNION 1 # define LA_TYPE LA_FLOAT -# ifdef _POSIX_VERSION +# ifdef _POSIX_VERSION # undef _POSIX_VERSION /* set in <unistd.h> */ -# endif +# endif /* _POSIX_VERSION */ # undef HASSETVBUF /* don't actually have setvbuf(3) */ # define setpgid setpgrp @@ -1443,15 +1591,15 @@ typedef int pid_t; # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ -# endif +# endif /* ! IDENTPROTO */ # ifndef _PATH_UNIX # define _PATH_UNIX "/dynix" -# endif +# endif /* ! _PATH_UNIX */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" -# endif -#endif +# endif /* ! _PATH_VENDOR_CF */ +#endif /* sequent */ /* @@ -1477,14 +1625,14 @@ typedef int pid_t; # define SPT_TYPE SPT_NONE /* don't use setproctitle */ # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ -# endif +# endif /* ! IDENTPROTO */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/sendmail.pid" -# endif -#endif +# endif /* ! _PATH_SENDMAILPID */ +#endif /* _SEQUENT_ */ /* @@ -1500,7 +1648,7 @@ typedef int pid_t; # define LA_TYPE LA_ZERO # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ # define SFS_BAVAIL f_bfree /* alternate field name */ -#endif +#endif /* UNICOS */ /* @@ -1523,24 +1671,24 @@ typedef int pid_t; # define TZ_TYPE TZ_TZNAME # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/sendmail.pid" -# endif -# undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */ -# undef S_IFIFO +# endif /* ! _PATH_SENDMAILPID */ +# undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */ +# undef S_IFIFO # define S_IFIFO 0010000 # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ -# endif +# endif /* ! IDENTPROTO */ # define RLIMIT_NEEDS_SYS_TIME_H 1 # if defined(NGROUPS_MAX) && !NGROUPS_MAX # undef NGROUPS_MAX -# endif -#endif +# endif /* defined(NGROUPS_MAX) && !NGROUPS_MAX */ +#endif /* apollo */ /* -** System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatiblity Libs ie. native) +** System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatibility Libs ie. native) ** ** Contributed by Paul Gampe <paulg@apnic.net> */ @@ -1558,18 +1706,20 @@ typedef int pid_t; # define SOCKOPT_LEN_T size_t # ifndef _PATH_UNIX # define _PATH_UNIX "/stand/unix" -# endif +# endif /* ! _PATH_UNIX */ # define SPT_PADCHAR '\0' /* pad process title with nulls */ -# define SYSLOG_BUFSIZE 1024 /* unsure */ +# ifndef SYSLOG_BUFSIZE +# define SYSLOG_BUFSIZE 1024 /* unsure */ +# endif /* SYSLOG_BUFSIZE */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/etc/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/sendmail.pid" -# endif -#endif +# endif /* ! _PATH_SENDMAILPID */ +#endif /* __svr5__ */ -/* ###################################################################### */ +/* ###################################################################### */ /* ** UnixWare 2.x @@ -1579,7 +1729,7 @@ typedef int pid_t; # define UNIXWARE 1 # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ # undef offsetof /* avoid stddefs.h, sys/sysmacros.h conflict */ -#endif +#endif /* UNIXWARE2 */ /* @@ -1604,15 +1754,15 @@ typedef int pid_t; # undef WEXITSTATUS # ifndef _PATH_UNIX # define _PATH_UNIX "/unix" -# endif +# endif /* ! _PATH_UNIX */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" -# endif +# endif /* ! _PATH_SENDMAILPID */ # define SYSLOG_BUFSIZE 128 -#endif +#endif /* UNIXWARE */ /* @@ -1625,13 +1775,13 @@ typedef int pid_t; # define SYSTEM5 1 /* looks like System V */ # ifndef HASGETUSERSHELL # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ -# endif +# endif /* ! HASGETUSERSHELL */ # define DEV_BSIZE 512 /* device block size not defined */ # define GIDSET_T gid_t # undef LOG /* syslog not available */ # define NEEDFSYNC 1 /* no fsync in system library */ # define GETSHORT _getshort -#endif +#endif /* CLIX */ /* @@ -1646,7 +1796,7 @@ typedef int pid_t; # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ # define SYSLOG_BUFSIZE 1024 # define SPT_TYPE SPT_NONE -#endif +#endif /* NCR_MP_RAS2 */ /* @@ -1657,10 +1807,19 @@ typedef int pid_t; #ifdef NCR_MP_RAS3 # define __svr4__ +# define HASFCHOWN 1 /* has fchown(2) call */ # define SIOCGIFNUM_IS_BROKEN 1 /* SIOCGIFNUM has non-std interface */ +# define SO_REUSEADDR_IS_BROKEN 1 /* doesn't work if accept() fails */ # define SYSLOG_BUFSIZE 1024 -# define SPT_TYPE SPT_NONE -#endif +# define SPT_TYPE SPT_NONE +# ifndef _XOPEN_SOURCE +# define _XOPEN_SOURCE +# define _XOPEN_SOURCE_EXTENDED 1 +# include <sys/resource.h> +# undef _XOPEN_SOURCE +# undef _XOPEN_SOURCE_EXTENDED +# endif /* ! _XOPEN_SOURCE */ +#endif /* NCR_MP_RAS3 */ /* @@ -1671,38 +1830,46 @@ typedef int pid_t; #ifdef NonStop_UX_BXX # define __svr4__ -#endif +#endif /* NonStop_UX_BXX */ /* -** Hitachi 3050R & 3050RX Workstations running HI-UX/WE2. +** Hitachi 3050R/3050RX and 3500 Workstations running HI-UX/WE2. ** -** Tested for 1.04 and 1.03 +** Tested for 1.04, 1.03 ** From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>. +** +** Tested for 4.02, 6.10 and 7.10 +** From Motonori NAKAMURA <motonori@media.kyoto-u.ac.jp>. */ -#ifdef __H3050R +#if !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE)) # define SYSTEM5 1 /* include all the System V defines */ # define HASINITGROUPS 1 /* has initgroups(3) call */ +# define HASFCHMOD 1 /* has fchmod(2) syscall */ # define setreuid(r, e) setresuid(r, e, -1) # define LA_TYPE LA_FLOAT +# define SPT_TYPE SPT_PSTAT # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ -# define HASSETVBUF /* HI-UX has no setlinebuf */ +# ifndef HASSETVBUF +# define HASSETVBUF /* HI-UX has no setlinebuf */ +# endif /* ! HASSETVBUF */ # ifndef GIDSET_T # define GIDSET_T gid_t -# endif +# endif /* ! GIDSET_T */ # ifndef _PATH_UNIX # define _PATH_UNIX "/HI-UX" -# endif +# endif /* ! _PATH_UNIX */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ -# endif +# endif /* ! IDENTPROTO */ # ifndef HASGETUSERSHELL # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ -# endif +# endif /* ! HASGETUSERSHELL */ +# define FDSET_CAST (int *) /* cast for fd_set parameters to select */ /* ** avoid m_flags conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h @@ -1712,11 +1879,11 @@ typedef int pid_t; # ifdef __STDC__ extern int syslog(int, char *, ...); -#else +# else /* __STDC__ */ extern int syslog(); -# endif +# endif /* __STDC__ */ -#endif +#endif /* !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE)) */ /* @@ -1736,7 +1903,7 @@ extern int syslog(); # define HASSETVBUF 1 /* has setvbuf(3) function */ # ifndef HASGETUSERSHELL # define HASGETUSERSHELL 0 /* does not have getusershell(3) function */ -# endif +# endif /* ! HASGETUSERSHELL */ # define GIDSET_T gid_t /* type of 2nd arg to getgroups(2) isn't int */ # define LA_TYPE LA_ZERO /* doesn't have load average */ # define SFS_TYPE SFS_4ARGS /* use 4-arg statfs() */ @@ -1744,8 +1911,8 @@ extern int syslog(); # define _PATH_UNIX "/unix" # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" -# endif -#endif +# endif /* ! _PATH_VENDOR_CF */ +#endif /* _UTS */ /* ** Cray Computer Corporation's CSOS @@ -1763,7 +1930,7 @@ extern int syslog(); # define SFS_BAVAIL f_bfree /* alternate field name */ # define _POSIX_CHOWN_RESTRICTED -1 extern struct group *getgrent(), *getgrnam(), *getgrgid(); -#endif +#endif /* _CRAYCOM */ /* @@ -1777,7 +1944,7 @@ extern struct group *getgrent(), *getgrnam(), *getgrgid(); /* NEWS-OS 4.2.1R */ # ifndef BSD # define BSD /* has BSD routines */ -# endif +# endif /* ! BSD */ # define HASUNSETENV 1 /* has unsetenv(2) call */ # undef HASSETVBUF /* don't actually have setvbuf(3) */ # define WAITUNION 1 /* use "union wait" as wait argument type */ @@ -1785,7 +1952,7 @@ extern struct group *getgrent(), *getgrnam(), *getgrgid(); # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ -# endif +# endif /* ! HASFLOCK */ # define setpgid setpgrp # undef WIFEXITED # undef WEXITSTATUS @@ -1796,33 +1963,33 @@ typedef int (*sigfunc_t)(); # define SIGFUNC_RETURN (0) # define SIGFUNC_DECL int -# else +# else /* ! __svr4 */ /* NEWS-OS 6.0.3 with /bin/cc */ # ifndef __svr4__ -# define __svr4__ /* use all System V Releae 4 defines below */ -# endif +# define __svr4__ /* use all System V Release 4 defines below */ +# endif /* ! __svr4__ */ # define HASSETSID 1 /* has Posix setsid(2) call */ # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ # define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */ # ifndef SPT_TYPE # define SPT_TYPE SPT_SYSMIPS /* use sysmips() (OS 6.0.2 or later) */ -# endif +# endif /* ! SPT_TYPE */ # define GIDSET_T gid_t # undef WIFEXITED # undef WEXITSTATUS # ifndef SYSLOG_BUFSIZE -# define SYSLOG_BUFSIZE 1024 -# endif +# define SYSLOG_BUFSIZE 256 +# endif /* ! SYSLOG_BUFSIZE */ # define _PATH_UNIX "/stand/unix" # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" -# endif +# endif /* ! _PATH_SENDMAILPID */ -# endif -#endif +# endif /* ! __svr4 */ +#endif /* sony_news */ /* @@ -1834,7 +2001,7 @@ typedef int (*sigfunc_t)(); #ifdef luna # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ -# endif +# endif /* ! IDENTPROTO */ # define HASUNSETENV 1 /* has unsetenv(2) call */ # define NEEDPUTENV 1 /* need putenv(3) call */ # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ @@ -1845,15 +2012,15 @@ typedef int (*sigfunc_t)(); # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ # define LA_TYPE LA_INT # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */ -# endif +# endif /* uniosb */ # ifdef luna2 # define LA_TYPE LA_SUBR # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */ -# endif +# endif /* luna2 */ # ifdef luna88k # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ # define LA_TYPE LA_INT -# endif +# endif /* luna88k */ # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ # define setpgid setpgrp # undef WIFEXITED @@ -1864,13 +2031,12 @@ typedef int (*sigfunc_t)(); # define SIGFUNC_RETURN (0) # define SIGFUNC_DECL int extern char *getenv(); -extern int errno; # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" -# endif -#endif +# endif /* ! _PATH_VENDOR_CF */ +#endif /* luna */ + - /* ** NEC EWS-UX/V 4.2 (with /usr/ucb/cc) ** @@ -1879,8 +2045,8 @@ extern int errno; #if defined(nec_ews_svr4) || defined(_nec_ews_svr4) # ifndef __svr4__ -# define __svr4__ /* use all System V Releae 4 defines below */ -# endif +# define __svr4__ /* use all System V Release 4 defines below */ +# endif /* ! __svr4__ */ # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ # define HASSETSID 1 /* has Posix setsid(2) call */ # define LA_TYPE LA_READKSYM /* use MIOC_READSYM ioctl */ @@ -1889,10 +2055,16 @@ extern int errno; # undef WIFEXITED # undef WEXITSTATUS # define NAMELISTMASK 0x7fffffff /* mask for nlist() values */ +# ifndef _PATH_VENDOR_CF +# define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" +# endif /* ! _PATH_VENDOR_CF */ +# ifndef _PATH_SENDMAILPID +# define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" +# endif /* ! _PATH_SENDMAILPID */ # ifndef SYSLOG_BUFSIZE # define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */ -# endif -#endif +# endif /* ! SYSLOG_BUFSIZE */ +#endif /* defined(nec_ews_svr4) || defined(_nec_ews_svr4) */ /* @@ -1900,7 +2072,7 @@ extern int errno; ** ** From Diego R. Lopez <drlopez@cica.es>. ** Additional changes from Fumio Moriya and Toshiaki Nomura of the -** Fujitsu Fresoftware gruop <dsfrsoft@oai6.yk.fujitsu.co.jp>. +** Fujitsu Fresoftware group <dsfrsoft@oai6.yk.fujitsu.co.jp>. */ #ifdef __uxp__ @@ -1912,17 +2084,17 @@ extern int errno; # define HASFLOCK 0 # if UXPDS == 10 # define HASSNPRINTF 0 /* no snprintf(3) or vsnprintf(3) */ -# else +# else /* UXPDS == 10 */ # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ -# endif +# endif /* UXPDS == 10 */ # define _PATH_UNIX "/stand/unix" # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" -# endif -#endif +# endif /* ! _PATH_SENDMAILPID */ +#endif /* __uxp__ */ /* ** Pyramid DC/OSx @@ -1934,8 +2106,8 @@ extern int errno; # define GIDSET_T gid_t # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ -# endif -#endif +# endif /* ! IDENTPROTO */ +#endif /* DCOSx */ /* ** Concurrent Computer Corporation Maxion @@ -1959,7 +2131,7 @@ extern int errno; # define SFS_BAVAIL f_bavail # ifndef SYSLOG_BUFSIZE # define SYSLOG_BUFSIZE 256 /* Use 256 bytes */ -# endif +# endif /* ! SYSLOG_BUFSIZE */ # undef WUNTRACED # undef WIFEXITED @@ -1969,7 +2141,7 @@ extern int errno; # undef WTERMSIG # undef WSTOPSIG -#endif +#endif /* __MAXION__ */ /* ** Harris Nighthawk PowerUX (nh6000 box) @@ -1980,29 +2152,30 @@ extern int errno; #ifdef _PowerUX # ifndef __svr4__ # define __svr4__ -# endif +# endif /* ! __svr4__ */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" -# endif +# endif /* ! _PATH_SENDMAILPID */ # define SYSLOG_BUFSIZE 1024 # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ # define LA_TYPE LA_ZERO typedef struct msgb mblk_t; # undef offsetof /* avoid stddefs.h and sys/sysmacros.h conflict */ -#endif +#endif /* _PowerUX */ /* -** Siemens Nixdorf Informationssysteme AG SINIX +** Siemens Nixdorf Informationssysteme AG SINIX ** ** Contributed by Gerald Rinske <Gerald.Rinske@mch.sni.de> ** of Siemens Business Services VAS. */ #ifdef sinix +# define HASRANDOM 0 /* has random(3) */ # define SYSLOG_BUFSIZE 1024 -#endif +#endif /* sinix */ /* ** CRAY T3E @@ -2012,7 +2185,31 @@ typedef struct msgb mblk_t; */ #ifdef _CRAY # define GET_IPOPT_DST(dst) *(struct in_addr *)&(dst) -#endif +#endif /* _CRAY */ + +/* +** Motorola 922, MC88110, UNIX SYSTEM V/88 Release 4.0 Version 4.3 +** +** Contributed by Sergey Rusanov <rsm@utfoms.udmnet.ru> +*/ + +#ifdef MOTO +# define HASFCHMOD 1 +# define HASSETRLIMIT 0 +# define HASSETSID 1 +# define HASSETREUID 1 +# define HASULIMIT 1 +# define HASWAITPID 1 +# define HASGETDTABLESIZE 1 +# define HASGETUSERSHELL 1 +# define IP_SRCROUTE 0 +# define IDENTPROTO 0 +# define RES_DNSRCH_VARIABLE _res_dnsrch +# define _PATH_UNIX "/unix" +# define _PATH_VENDOR_CF "/etc/sendmail.cf" +# define _PATH_SENDMAILPID "/var/run/sendmail.pid" +#endif /* MOTO */ + /********************************************************************** ** End of Per-Operating System defines @@ -2028,52 +2225,52 @@ typedef struct msgb mblk_t; # define HASINITGROUPS 1 /* has initgroups(3) call */ # ifndef IP_SRCROUTE # define IP_SRCROUTE 1 /* can check IP source routing */ -# endif +# endif /* ! IP_SRCROUTE */ # ifndef HASSETRLIMIT # define HASSETRLIMIT 1 /* has setrlimit(2) call */ -# endif +# endif /* ! HASSETRLIMIT */ # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ -# endif +# endif /* ! HASFLOCK */ # ifndef TZ_TYPE # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone variable */ -# endif -#endif +# endif /* ! TZ_TYPE */ +#endif /* BSD */ /* general System V Release 4 defines */ #ifdef __svr4__ # define SYSTEM5 1 -# define USESETEUID 1 /* has useable seteuid(2) call */ +# define USESETEUID 1 /* has usable seteuid(2) call */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # define BSD_COMP 1 /* get BSD ioctl calls */ # ifndef HASSETRLIMIT # define HASSETRLIMIT 1 /* has setrlimit(2) call */ -# endif +# endif /* ! HASSETRLIMIT */ # ifndef HASGETUSERSHELL # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ -# endif +# endif /* ! HASGETUSERSHELL */ # ifndef HASFCHMOD # define HASFCHMOD 1 /* most (all?) SVr4s seem to have fchmod(2) */ -# endif +# endif /* ! HASFCHMOD */ # ifndef _PATH_UNIX # define _PATH_UNIX "/unix" -# endif +# endif /* ! _PATH_UNIX */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" -# endif +# endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" -# endif +# endif /* ! _PATH_SENDMAILPID */ # ifndef SYSLOG_BUFSIZE # define SYSLOG_BUFSIZE 128 -# endif +# endif /* ! SYSLOG_BUFSIZE */ # ifndef SFS_TYPE # define SFS_TYPE SFS_STATVFS -# endif +# endif /* ! SFS_TYPE */ # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */ -#endif +#endif /* __svr4__ */ /* general System V defines */ #ifdef SYSTEM5 @@ -2083,38 +2280,30 @@ typedef struct msgb mblk_t; # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ # ifndef HASULIMIT # define HASULIMIT 1 /* has the ulimit(2) syscall */ -# endif +# endif /* ! HASULIMIT */ # ifndef LA_TYPE # ifdef MIOC_READKSYM # define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */ -# else +# else /* MIOC_READKSYM */ # define LA_TYPE LA_INT /* assume integer load average */ -# endif -# endif +# endif /* MIOC_READKSYM */ +# endif /* ! LA_TYPE */ # ifndef SFS_TYPE # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ -# endif +# endif /* ! SFS_TYPE */ # ifndef TZ_TYPE # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ -# endif -# define bcopy(s, d, l) (memmove((d), (s), (l))) -# define bzero(d, l) (memset((d), '\0', (l))) -# define bcmp(s, d, l) (memcmp((s), (d), (l))) -#endif +# endif /* ! TZ_TYPE */ +#endif /* SYSTEM5 */ /* general POSIX defines */ #ifdef _POSIX_VERSION # define HASSETSID 1 /* has Posix setsid(2) call */ # define HASWAITPID 1 /* has Posix waitpid(2) call */ # if _POSIX_VERSION >= 199500 && !defined(USESETEUID) -# define USESETEUID 1 /* has useable seteuid(2) call */ -# endif -# ifndef bcopy -# define bcopy(s, d, l) (memmove((d), (s), (l))) -# define bzero(d, l) (memset((d), '\0', (l))) -# define bcmp(s, d, l) (memcmp((s), (d), (l))) -# endif -#endif +# define USESETEUID 1 /* has usable seteuid(2) call */ +# endif /* _POSIX_VERSION >= 199500 && !defined(USESETEUID) */ +#endif /* _POSIX_VERSION */ /* ** Tweaking for systems that (for example) claim to be BSD or POSIX ** but don't have all the standard BSD or POSIX routines (boo hiss). @@ -2122,26 +2311,15 @@ typedef struct msgb mblk_t; #ifdef titan # undef HASINITGROUPS /* doesn't have initgroups(3) call */ -#endif +#endif /* titan */ #ifdef _CRAYCOM # undef HASSETSID /* despite POSIX claim, doesn't have setsid */ -#endif - -#ifdef ISC_UNIX -# undef bcopy /* despite SystemV claim, uses BSD bcopy */ -#endif - -#ifdef ALTOS_SYSTEM_V -# undef bcopy /* despite SystemV claim, uses BSD bcopy */ -# undef bzero /* despite SystemV claim, uses BSD bzero */ -# undef bcmp /* despite SystemV claim, uses BSD bcmp */ -#endif - -#if defined(sun) && !defined(BSD) && !defined(SOLARIS) && !defined(__svr4__) && !defined(__SVR4) -# undef bcopy /* SunOS 4 doesn't have memmove() */ -#endif +#endif /* _CRAYCOM */ +#ifdef MOTO +# undef USESETEUID +#endif /* MOTO */ /* ** Due to a "feature" in some operating systems such as Ultrix 4.3 and @@ -2156,55 +2334,77 @@ typedef struct msgb mblk_t; #ifndef IDENTPROTO # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ -#endif +#endif /* ! IDENTPROTO */ #ifndef IP_SRCROUTE # define IP_SRCROUTE 1 /* Detect IP source routing */ -#endif +#endif /* ! IP_SRCROUTE */ #ifndef HASGETUSERSHELL # define HASGETUSERSHELL 1 /* libc has getusershell(3) call */ -#endif +#endif /* ! HASGETUSERSHELL */ #ifndef NETUNIX # define NETUNIX 1 /* include unix domain support */ -#endif +#endif /* ! NETUNIX */ + +#ifndef HASRANDOM +# define HASRANDOM 1 /* has random(3) support */ +#endif /* ! HASRANDOM */ #ifndef HASFLOCK # define HASFLOCK 0 /* assume no flock(2) support */ -#endif +#endif /* ! HASFLOCK */ #ifndef HASSETREUID # define HASSETREUID 0 /* assume no setreuid(2) call */ -#endif +#endif /* ! HASSETREUID */ #ifndef HASFCHMOD # define HASFCHMOD 0 /* assume no fchmod(2) syscall */ -#endif +#endif /* ! HASFCHMOD */ #ifndef USESETEUID # define USESETEUID 0 /* assume no seteuid(2) call or no saved ids */ -#endif +#endif /* ! USESETEUID */ #ifndef HASSETRLIMIT # define HASSETRLIMIT 0 /* assume no setrlimit(2) support */ -#endif +#endif /* ! HASSETRLIMIT */ #ifndef HASULIMIT # define HASULIMIT 0 /* assume no ulimit(2) support */ -#endif +#endif /* ! HASULIMIT */ #ifndef SECUREWARE # define SECUREWARE 0 /* assume no SecureWare C2 auditing hooks */ -#endif +#endif /* ! SECUREWARE */ #ifndef USE_SIGLONGJMP # define USE_SIGLONGJMP 0 /* assume setjmp handles signals properly */ -#endif +#endif /* ! USE_SIGLONGJMP */ #ifndef FDSET_CAST # define FDSET_CAST /* (empty) cast for fd_set arg to select */ -#endif +#endif /* ! FDSET_CAST */ + +/* +** Pick a mailer setuid method for changing the current uid +*/ + +#define USE_SETEUID 0 +#define USE_SETREUID 1 +#define USE_SETUID 2 + +#if USESETEUID +# define MAILER_SETUID_METHOD USE_SETEUID +#else /* USESETEUID */ +# if HASSETREUID +# define MAILER_SETUID_METHOD USE_SETREUID +# else /* HASSETREUID */ +# define MAILER_SETUID_METHOD USE_SETUID +# endif /* HASSETREUID */ +#endif /* USESETEUID */ /* ** If no type for argument two of getgroups call is defined, assume @@ -2214,39 +2414,39 @@ typedef struct msgb mblk_t; #ifndef GIDSET_T # define GIDSET_T int -#endif +#endif /* ! GIDSET_T */ #ifndef UID_T # define UID_T uid_t -#endif +#endif /* ! UID_T */ #ifndef GID_T # define GID_T gid_t -#endif +#endif /* ! GID_T */ #ifndef SIZE_T # define SIZE_T size_t -#endif +#endif /* ! SIZE_T */ #ifndef MODE_T # define MODE_T mode_t -#endif +#endif /* ! MODE_T */ #ifndef ARGV_T # define ARGV_T char ** -#endif +#endif /* ! ARGV_T */ #ifndef SOCKADDR_LEN_T # define SOCKADDR_LEN_T int -#endif +#endif /* ! SOCKADDR_LEN_T */ #ifndef SOCKOPT_LEN_T # define SOCKOPT_LEN_T int -#endif +#endif /* ! SOCKOPT_LEN_T */ #ifndef QUAD_T # define QUAD_T unsigned long -#endif +#endif /* ! QUAD_T */ /********************************************************************** ** Remaining definitions should never have to be changed. They are ** primarily to provide back compatibility for older systems -- for @@ -2256,46 +2456,60 @@ typedef struct msgb mblk_t; /* System 5 compatibility */ #ifndef S_ISREG # define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG) -#endif +#endif /* ! S_ISREG */ #ifndef S_ISDIR # define S_ISDIR(foo) ((foo & S_IFMT) == S_IFDIR) -#endif +#endif /* ! S_ISDIR */ #if !defined(S_ISLNK) && defined(S_IFLNK) # define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK) -#endif +#endif /* !defined(S_ISLNK) && defined(S_IFLNK) */ +#if !defined(S_ISFIFO) +# if defined(S_IFIFO) +# define S_ISFIFO(foo) ((foo & S_IFMT) == S_IFIFO) +# else /* defined(S_IFIFO) */ +# define S_ISFIFO(foo) FALSE +# endif /* defined(S_IFIFO) */ +#endif /* !defined(S_ISFIFO) */ #ifndef S_IRUSR # define S_IRUSR 0400 -#endif +#endif /* ! S_IRUSR */ #ifndef S_IWUSR # define S_IWUSR 0200 -#endif +#endif /* ! S_IWUSR */ #ifndef S_IRGRP # define S_IRGRP 0040 -#endif +#endif /* ! S_IRGRP */ #ifndef S_IWGRP # define S_IWGRP 0020 -#endif +#endif /* ! S_IWGRP */ #ifndef S_IROTH # define S_IROTH 0004 -#endif +#endif /* ! S_IROTH */ #ifndef S_IWOTH # define S_IWOTH 0002 -#endif +#endif /* ! S_IWOTH */ + +/* close-on-exec flag */ +#ifndef FD_CLOEXEC +# define FD_CLOEXEC 1 +#endif /* ! FD_CLOEXEC */ /* ** Older systems don't have this error code -- it should be in ** /usr/include/sysexits.h. */ -# ifndef EX_CONFIG +#ifndef EX_CONFIG # define EX_CONFIG 78 /* configuration error */ -# endif +#endif /* ! EX_CONFIG */ -/* pseudo-code used in server SMTP */ -# define EX_QUIT 22 /* drop out of server immediately */ +/* pseudo-codes */ +#define EX_QUIT 22 /* drop out of server immediately */ +#define EX_RESTART 23 /* restart sendmail daemon */ +#define EX_SHUTDOWN 24 /* shutdown sendmail daemon */ /* pseudo-code used for mci_setstat */ -# define EX_NOTSTICKY -5 /* don't save persistent status */ +#define EX_NOTSTICKY -5 /* don't save persistent status */ /* @@ -2305,67 +2519,76 @@ typedef struct msgb mblk_t; #define ST_MODE_NOFILE 0171147 /* unlikely to occur */ -/* -** These are used in a few cases where we need some special -** error codes, but where the system doesn't provide something -** reasonable. They are printed in errstring. -*/ - -#ifndef E_PSEUDOBASE -# define E_PSEUDOBASE 256 -#endif - -#define E_SM_OPENTIMEOUT (E_PSEUDOBASE + 0) /* Timeout on file open */ -#define E_SM_NOSLINK (E_PSEUDOBASE + 1) /* Symbolic links not allowed */ -#define E_SM_NOHLINK (E_PSEUDOBASE + 2) /* Hard links not allowed */ -#define E_SM_REGONLY (E_PSEUDOBASE + 3) /* Regular files only */ -#define E_SM_ISEXEC (E_PSEUDOBASE + 4) /* Executable files not allowed */ -#define E_SM_WWDIR (E_PSEUDOBASE + 5) /* World writable directory */ -#define E_SM_GWDIR (E_PSEUDOBASE + 6) /* Group writable directory */ -#define E_SM_FILECHANGE (E_PSEUDOBASE + 7) /* File changed after open */ -#define E_SM_WWFILE (E_PSEUDOBASE + 8) /* World writable file */ -#define E_SM_GWFILE (E_PSEUDOBASE + 9) /* Group writable file */ -#define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */ - /* type of arbitrary pointer */ #ifndef ARBPTR_T # define ARBPTR_T void * -#endif +#endif /* ! ARBPTR_T */ #ifndef __P -# include "cdefs.h" -#endif +# include "sendmail/cdefs.h" +#endif /* ! __P */ #if HESIOD && !defined(NAMED_BIND) # define NAMED_BIND 1 /* not one without the other */ -#endif +#endif /* HESIOD && !defined(NAMED_BIND) */ -#if NAMED_BIND && !defined(__ksr__) && !defined(h_errno) +# if NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno ) extern int h_errno; -#endif +# endif /* NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno ) */ + +#ifdef LDAPMAP +# include <sys/time.h> +# include <lber.h> +# include <ldap.h> + +/* Some LDAP constants */ +# define LDAPMAP_FALSE 0 +# define LDAPMAP_TRUE 1 + +/* +** ldap_init(3) is broken in Umich 3.x and OpenLDAP 1.0/1.1. +** Use the lack of LDAP_OPT_SIZELIMIT to detect old API implementations +** and assume (falsely) that all old API implementations are broken. +** (OpenLDAP 1.2 and later have a working ldap_init(), add -DUSE_LDAP_INIT) +*/ + +# if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT) +# define USE_LDAP_INIT 1 +# endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT) */ + +/* +** LDAP_OPT_SIZELIMIT is not defined under Umich 3.x nor OpenLDAP 1.x, +** hence ldap_set_option() must not exist. +*/ + +# if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION) +# define USE_LDAP_SET_OPTION 1 +# endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION) */ + +#endif /* LDAPMAP */ /* ** Do some required dependencies */ -#if NETINET || NETISO +#if NETINET || NETINET6 || NETISO # ifndef SMTP # define SMTP 1 /* enable user and server SMTP */ -# endif +# endif /* ! SMTP */ # ifndef QUEUE # define QUEUE 1 /* enable queueing */ -# endif +# endif /* ! QUEUE */ # ifndef DAEMON # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ -# endif -#endif +# endif /* ! DAEMON */ +#endif /* NETINET || NETINET6 || NETISO */ /* ** Arrange to use either varargs or stdargs */ -# ifdef __STDC__ +#ifdef __STDC__ # include <stdarg.h> @@ -2373,7 +2596,7 @@ extern int h_errno; # define VA_START(f) va_start(ap, f) # define VA_END va_end(ap) -# else +#else /* __STDC__ */ # include <varargs.h> @@ -2381,91 +2604,100 @@ extern int h_errno; # define VA_START(f) va_start(ap) # define VA_END va_end(ap) -# endif +#endif /* __STDC__ */ -#ifdef HASUNAME +#if HASUNAME # include <sys/utsname.h> # ifdef newstr # undef newstr -# endif -#else /* ! HASUNAME */ +# endif /* newstr */ +#else /* HASUNAME */ # define NODE_LENGTH 32 struct utsname { - char nodename[NODE_LENGTH+1]; + char nodename[NODE_LENGTH + 1]; }; #endif /* HASUNAME */ #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V) # define MAXHOSTNAMELEN 256 -#endif +#endif /* !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V) */ #if !defined(SIGCHLD) && defined(SIGCLD) # define SIGCHLD SIGCLD -#endif +#endif /* !defined(SIGCHLD) && defined(SIGCLD) */ #ifndef STDIN_FILENO # define STDIN_FILENO 0 -#endif +#endif /* ! STDIN_FILENO */ #ifndef STDOUT_FILENO # define STDOUT_FILENO 1 -#endif +#endif /* ! STDOUT_FILENO */ #ifndef STDERR_FILENO # define STDERR_FILENO 2 -#endif +#endif /* ! STDERR_FILENO */ #ifndef LOCK_SH # define LOCK_SH 0x01 /* shared lock */ # define LOCK_EX 0x02 /* exclusive lock */ # define LOCK_NB 0x04 /* non-blocking lock */ # define LOCK_UN 0x08 /* unlock */ -#endif +#endif /* ! LOCK_SH */ #ifndef S_IXOTH # define S_IXOTH (S_IEXEC >> 6) -#endif +#endif /* ! S_IXOTH */ #ifndef S_IXGRP # define S_IXGRP (S_IEXEC >> 3) -#endif +#endif /* ! S_IXGRP */ #ifndef S_IXUSR # define S_IXUSR (S_IEXEC) -#endif +#endif /* ! S_IXUSR */ #ifndef SEEK_SET # define SEEK_SET 0 # define SEEK_CUR 1 # define SEEK_END 2 -#endif +#endif /* ! SEEK_SET */ #ifndef SIG_ERR # define SIG_ERR ((void (*)()) -1) -#endif +#endif /* ! SIG_ERR */ #ifndef WEXITSTATUS # define WEXITSTATUS(st) (((st) >> 8) & 0377) -#endif +#endif /* ! WEXITSTATUS */ #ifndef WIFEXITED # define WIFEXITED(st) (((st) & 0377) == 0) -#endif +#endif /* ! WIFEXITED */ +#ifndef WIFSTOPPED +# define WIFSTOPPED(st) (((st) & 0100) == 0) +#endif /* ! WIFSTOPPED */ +#ifndef WCOREDUMP +# define WCOREDUMP(st) (((st) & 0200) != 0) +#endif /* ! WCOREDUMP */ +#ifndef WTERMSIG +# define WTERMSIG(st) (((st) & 0177)) +#endif /* ! WTERMSIG */ #ifndef SIGFUNC_DEFINED typedef void (*sigfunc_t) __P((int)); -#endif +#endif /* ! SIGFUNC_DEFINED */ #ifndef SIGFUNC_RETURN # define SIGFUNC_RETURN -#endif +#endif /* ! SIGFUNC_RETURN */ #ifndef SIGFUNC_DECL # define SIGFUNC_DECL void -#endif +#endif /* ! SIGFUNC_DECL */ /* size of syslog buffer */ #ifndef SYSLOG_BUFSIZE # define SYSLOG_BUFSIZE 1024 -#endif +#endif /* ! SYSLOG_BUFSIZE */ /* ** Size of prescan buffer. @@ -2473,12 +2705,23 @@ typedef void (*sigfunc_t) __P((int)); ** not be changed; there are some hard-to-define dependencies. */ -# define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ +#define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ /* fork routine -- set above using #ifdef _osname_ or in Makefile */ -# ifndef FORK +#ifndef FORK # define FORK fork /* function to call to fork mailer */ -# endif +#endif /* ! FORK */ + + +/* random routine -- set above using #ifdef _osname_ or in Makefile */ +#if HASRANDOM +# define get_random() random() +#else /* HASRANDOM */ +# define get_random() ((long) rand()) +# ifndef RANDOMSHIFT +# define RANDOMSHIFT 8 +# endif /* RANDOMSHIFT */ +#endif /* HASRANDOM */ /* ** Default to using scanf in readcf. @@ -2486,7 +2729,14 @@ typedef void (*sigfunc_t) __P((int)); #ifndef SCANF # define SCANF 1 -#endif +#endif /* ! SCANF */ + +#if _FFR_MILTER +/* 32 bit type */ +# ifndef SM_INT32 +# define SM_INT32 int32_t +# endif /* SM_INT32 */ +#endif /* _FFR_MILTER */ /* ** SVr4 and similar systems use different routines for setjmp/longjmp @@ -2496,21 +2746,35 @@ typedef void (*sigfunc_t) __P((int)); #if USE_SIGLONGJMP # ifdef jmp_buf # undef jmp_buf -# endif +# endif /* jmp_buf */ # define jmp_buf sigjmp_buf # ifdef setjmp # undef setjmp -# endif +# endif /* setjmp */ # define setjmp(env) sigsetjmp(env, 1) # ifdef longjmp # undef longjmp -# endif +# endif /* longjmp */ # define longjmp(env, val) siglongjmp(env, val) -#endif +#endif /* USE_SIGLONGJMP */ #if !defined(NGROUPS_MAX) && defined(NGROUPS) # define NGROUPS_MAX NGROUPS /* POSIX naming convention */ -#endif +#endif /* !defined(NGROUPS_MAX) && defined(NGROUPS) */ + +/* +** Some snprintf() implementations are rumored not to NUL terminate. +*/ +#if SNPRINTF_IS_BROKEN +# ifdef snprintf +# undef snprintf +# endif /* snprintf */ +# define snprintf sm_snprintf +# ifdef vsnprintf +# undef vsnprintf +# endif /* vsnprintf */ +# define vsnprintf sm_vsnprintf +#endif /* SNPRINTF_IS_BROKEN */ /* ** If we don't have a system syslog, simulate it. @@ -2525,4 +2789,14 @@ typedef void (*sigfunc_t) __P((int)); # define LOG_NOTICE 5 /* normal but significant condition */ # define LOG_INFO 6 /* informational */ # define LOG_DEBUG 7 /* debug-level messages */ -#endif +#endif /* !LOG */ + +#if SFIO && defined(ERRLIST_PREDEFINED) +# undef ERRLIST_PREDEFINED +#endif /* SFIO && defined(ERRLIST_PREDEFINED) */ + +#ifndef SFIO_STDIO_COMPAT +# define SFIO_STDIO_COMPAT 0 +#endif /* ! SFIO_STDIO_COMPAT */ + +#endif /* CONF_H */ |