1 /* 2 * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers. 3 * All rights reserved. 4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. 5 * Copyright (c) 1988, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * By using this file, you agree to the terms and conditions set 9 * forth in the LICENSE file which can be found at the top level of 10 * the sendmail distribution. 11 * 12 * 13 * $Id: conf.h,v 8.496.4.54 2001/07/31 22:30:24 gshapiro Exp $ 14 */ 15 16 /* $FreeBSD$ */ 17 18 /* 19 ** CONF.H -- All user-configurable parameters for sendmail 20 ** 21 ** Send updates to sendmail@Sendmail.ORG so they will be 22 ** included in the next release. 23 */ 24 25 #ifndef CONF_H 26 #define CONF_H 1 27 28 #ifdef __GNUC__ 29 struct rusage; /* forward declaration to get gcc to shut up in wait.h */ 30 #endif /* __GNUC__ */ 31 32 # include <sys/param.h> 33 # include <sys/types.h> 34 # if SFIO && defined(SF_APPEND) 35 # undef SF_APPEND /* Both sfio/stdio.h and sys/stat.h define it */ 36 # endif /* SFIO && defined(SF_APPEND) */ 37 # include <sys/stat.h> 38 # ifndef __QNX__ 39 /* in QNX this grabs bogus LOCK_* manifests */ 40 # include <sys/file.h> 41 # endif /* ! __QNX__ */ 42 # include <sys/wait.h> 43 # include <limits.h> 44 # include <fcntl.h> 45 # include <signal.h> 46 # include <netdb.h> 47 # include <pwd.h> 48 # include <grp.h> 49 50 /* make sure TOBUFSIZ isn't larger than system limit for size of exec() args */ 51 #ifdef ARG_MAX 52 # if ARG_MAX > 4096 53 # define SM_ARG_MAX 4096 54 # else /* ARG_MAX > 4096 */ 55 # define SM_ARG_MAX ARG_MAX 56 # endif /* ARG_MAX > 4096 */ 57 #else /* ARG_MAX */ 58 # define SM_ARG_MAX 4096 59 #endif /* ARG_MAX */ 60 61 /********************************************************************** 62 ** Table sizes, etc.... 63 ** There shouldn't be much need to change these.... 64 **********************************************************************/ 65 66 #define MAXLINE 2048 /* max line length */ 67 #define MAXNAME 256 /* max length of a name */ 68 #define MAXPV 256 /* max # of parms to mailers */ 69 #define MAXATOM 1000 /* max atoms per address */ 70 #define MAXRWSETS 200 /* max # of sets of rewriting rules */ 71 #define MAXPRIORITIES 25 /* max values for Precedence: field */ 72 #define MAXMXHOSTS 100 /* max # of MX records for one host */ 73 #define SMTPLINELIM 990 /* maximum SMTP line length */ 74 #define MAXKEY 128 /* maximum size of a database key */ 75 #define MEMCHUNKSIZE 1024 /* chunk size for memory allocation */ 76 #define MAXUSERENVIRON 100 /* max envars saved, must be >= 3 */ 77 #define MAXALIASDB 12 /* max # of alias databases */ 78 #define MAXMAPSTACK 12 /* max # of stacked or sequenced maps */ 79 #if _FFR_MILTER 80 # define MAXFILTERS 25 /* max # of milter filters */ 81 # define MAXFILTERMACROS 50 /* max # of macros per milter cmd */ 82 #endif /* _FFR_MILTER */ 83 #define MAXSMTPARGS 20 /* max # of ESMTP args for MAIL/RCPT */ 84 #define MAXTOCLASS 8 /* max # of message timeout classes */ 85 #define MAXRESTOTYPES 3 /* max # of resolver timeout types */ 86 #define MAXMIMEARGS 20 /* max args in Content-Type: */ 87 #define MAXMIMENESTING 20 /* max MIME multipart nesting */ 88 #define QUEUESEGSIZE 1000 /* increment for queue size */ 89 #define MAXQFNAME 21 /* max qf file name length */ 90 #define MACBUFSIZE 4096 /* max expanded macro buffer size */ 91 #define TOBUFSIZE SM_ARG_MAX /* max buffer to hold address list */ 92 #define MAXSHORTSTR 203 /* max short string length */ 93 #define MAXMACNAMELEN 25 /* max macro name length */ 94 #define MAXMACROID 0377 /* max macro id number */ 95 /* Must match (BITMAPBITS - 1) */ 96 #ifndef MAXHDRSLEN 97 # define MAXHDRSLEN (32 * 1024) /* max size of message headers */ 98 #endif /* ! MAXHDRSLEN */ 99 #define MAXDAEMONS 10 /* max number of ports to listen to */ 100 #ifndef MAXINTERFACES 101 # define MAXINTERFACES 512 /* number of interfaces to probe */ 102 #endif /* MAXINTERFACES */ 103 #ifndef MAXSYMLINKS 104 # define MAXSYMLINKS 32 /* max number of symlinks in a path */ 105 #endif /* ! MAXSYMLINKS */ 106 #define MAXLINKPATHLEN (MAXPATHLEN * MAXSYMLINKS) /* max link-expanded file */ 107 #define DATA_PROGRESS_TIMEOUT 300 /* how ofter to check DATA progress */ 108 #define ENHSCLEN 10 /* max len of enhanced status code */ 109 #if _FFR_DYNAMIC_TOBUF 110 # define DEFAULT_MAX_RCPT 100 /* max number of RCPTs per envelope */ 111 #endif /* _FFR_DYNAMIC_TOBUF */ 112 113 #if SASL 114 # ifndef AUTH_MECHANISMS 115 # if STARTTLS && _FFR_EXT_MECH 116 # define AUTH_MECHANISMS "EXTERNAL GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5" 117 # else /* STARTTLS && _FFR_EXT_MECH */ 118 # define AUTH_MECHANISMS "GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5" 119 # endif /* STARTTLS && _FFR_EXT_MECH */ 120 # endif /* ! AUTH_MECHANISMS */ 121 #endif /* SASL */ 122 123 #ifdef LDAPMAP 124 # define LDAPMAP_MAX_ATTR 64 125 # define LDAPMAP_MAX_FILTER 1024 126 # define LDAPMAP_MAX_PASSWD 256 127 #endif /* LDAPMAP */ 128 129 /********************************************************************** 130 ** Compilation options. 131 ** #define these to 1 if they are available; 132 ** #define them to 0 otherwise. 133 ** All can be overridden from Makefile. 134 **********************************************************************/ 135 136 #ifndef NETINET 137 # define NETINET 1 /* include internet support */ 138 #endif /* ! NETINET */ 139 140 #ifndef NETINET6 141 # define NETINET6 0 /* do not include IPv6 support */ 142 #endif /* ! NETINET6 */ 143 144 #ifndef NETISO 145 # define NETISO 0 /* do not include ISO socket support */ 146 #endif /* ! NETISO */ 147 148 #ifndef NAMED_BIND 149 # define NAMED_BIND 1 /* use Berkeley Internet Domain Server */ 150 #endif /* ! NAMED_BIND */ 151 152 #ifndef XDEBUG 153 # define XDEBUG 1 /* enable extended debugging */ 154 #endif /* ! XDEBUG */ 155 156 #ifndef MATCHGECOS 157 # define MATCHGECOS 1 /* match user names from gecos field */ 158 #endif /* ! MATCHGECOS */ 159 160 #ifndef DSN 161 # define DSN 1 /* include delivery status notification code */ 162 #endif /* ! DSN */ 163 164 #if !defined(USERDB) && (defined(NEWDB) || defined(HESIOD)) 165 # define USERDB 1 /* look in user database */ 166 #endif /* !defined(USERDB) && (defined(NEWDB) || defined(HESIOD)) */ 167 168 #ifndef MIME8TO7 169 # define MIME8TO7 1 /* 8->7 bit MIME conversions */ 170 #endif /* ! MIME8TO7 */ 171 172 #ifndef MIME7TO8 173 # define MIME7TO8 1 /* 7->8 bit MIME conversions */ 174 #endif /* ! MIME7TO8 */ 175 176 /********************************************************************** 177 ** "Hard" compilation options. 178 ** #define these if they are available; comment them out otherwise. 179 ** These cannot be overridden from the Makefile, and should really not 180 ** be turned off unless absolutely necessary. 181 **********************************************************************/ 182 183 #define LOG 1 /* enable logging -- don't turn off */ 184 185 /********************************************************************** 186 ** End of site-specific configuration. 187 **********************************************************************/ 188 /* 189 ** General "standard C" defines. 190 ** 191 ** These may be undone later, to cope with systems that claim to 192 ** be Standard C but aren't. Gcc is the biggest offender -- it 193 ** doesn't realize that the library is part of the language. 194 ** 195 ** Life would be much easier if we could get rid of this sort 196 ** of bozo problems. 197 */ 198 199 #ifdef __STDC__ 200 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 201 #endif /* __STDC__ */ 202 203 /* 204 ** Assume you have standard calls; can be #undefed below if necessary. 205 */ 206 207 #ifndef HASLSTAT 208 # define HASLSTAT 1 /* has lstat(2) call */ 209 #endif /* ! HASLSTAT */ 210 /********************************************************************** 211 ** Operating system configuration. 212 ** 213 ** Unless you are porting to a new OS, you shouldn't have to 214 ** change these. 215 **********************************************************************/ 216 217 /* 218 ** HP-UX -- tested for 8.07, 9.00, and 9.01. 219 ** 220 ** If V4FS is defined, compile for HP-UX 10.0. 221 ** 11.x support from Richard Allen <ra@hp.is>. 222 */ 223 224 #ifdef __hpux 225 /* common definitions for HP-UX 9.x and 10.x */ 226 # undef m_flags /* conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h on HP 300 */ 227 # define SYSTEM5 1 /* include all the System V defines */ 228 # define HASINITGROUPS 1 /* has initgroups(3) call */ 229 # define HASFCHMOD 1 /* has fchmod(2) syscall */ 230 # define USESETEUID 1 /* has usable seteuid(2) call */ 231 # define BOGUS_O_EXCL 1 /* exclusive open follows symlinks */ 232 # define seteuid(e) setresuid(-1, e, -1) 233 # define IP_SRCROUTE 1 /* can check IP source routing */ 234 # define LA_TYPE LA_HPUX 235 # define SPT_TYPE SPT_PSTAT 236 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 237 # define GIDSET_T gid_t 238 # ifndef HASGETUSERSHELL 239 # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ 240 # endif /* ! HASGETUSERSHELL */ 241 # ifdef HPUX11 242 # define HASFCHOWN 1 /* has fchown(2) */ 243 # define HASSNPRINTF 1 /* has snprintf(3) */ 244 # ifndef BROKEN_RES_SEARCH 245 # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ 246 # endif /* ! BROKEN_RES_SEARCH */ 247 # else /* HPUX11 */ 248 # ifndef NOT_SENDMAIL 249 # define syslog hard_syslog 250 # endif /* ! NOT_SENDMAIL */ 251 # endif /* HPUX11 */ 252 # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */ 253 254 # ifdef V4FS 255 /* HP-UX 10.x */ 256 # define _PATH_UNIX "/stand/vmunix" 257 # ifndef _PATH_VENDOR_CF 258 # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" 259 # endif /* ! _PATH_VENDOR_CF */ 260 # ifndef _PATH_SENDMAILPID 261 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 262 # endif /* ! _PATH_SENDMAILPID */ 263 # ifndef IDENTPROTO 264 # define IDENTPROTO 1 /* TCP/IP implementation fixed in 10.0 */ 265 # endif /* ! IDENTPROTO */ 266 # include <sys/mpctl.h> /* for mpctl() in get_num_procs_online() */ 267 # else /* V4FS */ 268 /* HP-UX 9.x */ 269 # define _PATH_UNIX "/hp-ux" 270 # ifndef _PATH_VENDOR_CF 271 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 272 # endif /* ! _PATH_VENDOR_CF */ 273 # ifndef IDENTPROTO 274 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 275 # endif /* ! IDENTPROTO */ 276 # ifdef __STDC__ 277 extern void hard_syslog(int, char *, ...); 278 # else /* __STDC__ */ 279 extern void hard_syslog(); 280 # endif /* __STDC__ */ 281 # define FDSET_CAST (int *) /* cast for fd_set parameters to select */ 282 # endif /* V4FS */ 283 284 #endif /* __hpux */ 285 286 287 /* 288 ** IBM AIX 4.x 289 */ 290 291 #ifdef _AIX4 292 # define _AIX3 1 /* pull in AIX3 stuff */ 293 # define BSD4_4_SOCKADDR /* has sa_len */ 294 # define USESETEUID 1 /* seteuid(2) works */ 295 # define TZ_TYPE TZ_NAME /* use tzname[] vector */ 296 # define SOCKOPT_LEN_T size_t /* arg#5 to getsockopt */ 297 # if _AIX4 >= 40200 298 # define HASSETREUID 1 /* setreuid(2) works as of AIX 4.2 */ 299 # define SOCKADDR_LEN_T size_t /* e.g., arg#3 to accept, getsockname */ 300 # endif /* _AIX4 >= 40200 */ 301 # if _AIX4 >= 40300 302 # define HASSNPRINTF 1 /* has snprintf starting in 4.3 */ 303 # endif /* _AIX4 >= 40300 */ 304 # if defined(_ILS_MACROS) /* IBM versions aren't side-effect clean */ 305 # undef isascii 306 # define isascii(c) !(c & ~0177) 307 # undef isdigit 308 # define isdigit(__a) (_IS(__a,_ISDIGIT)) 309 # undef isspace 310 # define isspace(__a) (_IS(__a,_ISSPACE)) 311 # endif /* defined(_ILS_MACROS) */ 312 #endif /* _AIX4 */ 313 314 315 /* 316 ** IBM AIX 3.x -- actually tested for 3.2.3 317 */ 318 319 #ifdef _AIX3 320 # include <paths.h> 321 # include <sys/machine.h> /* to get byte order */ 322 # include <sys/select.h> 323 # define HASFCHOWN 1 /* has fchown(2) */ 324 # define HASINITGROUPS 1 /* has initgroups(3) call */ 325 # define HASUNAME 1 /* use System V uname(2) system call */ 326 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 327 # define HASFCHMOD 1 /* has fchmod(2) syscall */ 328 # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ 329 # define GIDSET_T gid_t 330 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 331 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 332 # define LA_TYPE LA_INT 333 # define FSHIFT 16 334 # define LA_AVENRUN "avenrun" 335 #endif /* _AIX3 */ 336 337 338 /* 339 ** IBM AIX 2.2.1 -- actually tested for osupdate level 2706+1773 340 ** 341 ** From Mark Whetzel <markw@wg.waii.com>. 342 */ 343 344 #ifdef AIX /* AIX/RT compiler pre-defines this */ 345 # include <paths.h> 346 # include <sys/time.h> /* AIX/RT resource.h does NOT include this */ 347 # define HASINITGROUPS 1 /* has initgroups(3) call */ 348 # define HASUNAME 1 /* use System V uname(2) system call */ 349 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 350 # define HASFCHMOD 0 /* does not have fchmod(2) syscall */ 351 # define HASSETREUID 1 /* use setreuid(2) -lbsd system call */ 352 # define HASSETVBUF 1 /* use setvbuf(2) system call */ 353 # define HASSETRLIMIT 0 /* does not have setrlimit call */ 354 # define HASFLOCK 0 /* does not have flock call - use fcntl */ 355 # define HASULIMIT 1 /* use ulimit instead of setrlimit call */ 356 # define NEEDGETOPT 1 /* Do we need theirs or ours */ 357 # define SYS5SETPGRP 1 /* don't have setpgid on AIX/RT */ 358 # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ 359 # define BSD4_3 1 /* NOT bsd 4.4 or posix signals */ 360 # define GIDSET_T int 361 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 362 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 363 # define LA_TYPE LA_SUBR /* use our ported loadavgd daemon */ 364 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 365 # define ARBPTR_T int * 366 # define void int 367 typedef int pid_t; 368 /* RTisms for BSD compatibility, specified in the Makefile 369 define BSD 1 370 define BSD_INCLUDES 1 371 define BSD_REMAP_SIGNAL_TO_SIGVEC 372 RTisms needed above */ 373 /* make this sendmail in a completely different place */ 374 # ifndef _PATH_VENDOR_CF 375 # define _PATH_VENDOR_CF "/usr/local/newmail/sendmail.cf" 376 # endif /* ! _PATH_VENDOR_CF */ 377 # ifndef _PATH_SENDMAILPID 378 # define _PATH_SENDMAILPID "/usr/local/newmail/sendmail.pid" 379 # endif /* ! _PATH_SENDMAILPID */ 380 #endif /* AIX */ 381 382 383 /* 384 ** Silicon Graphics IRIX 385 ** 386 ** Compiles on 4.0.1. 387 ** 388 ** Use IRIX64 instead of IRIX for 64-bit IRIX (6.0). 389 ** Use IRIX5 instead of IRIX for IRIX 5.x. 390 ** 391 ** This version tries to be adaptive using _MIPS_SIM: 392 ** _MIPS_SIM == _ABIO32 (= 1) Abi: -32 on IRIX 6.2 393 ** _MIPS_SIM == _ABIN32 (= 2) Abi: -n32 on IRIX 6.2 394 ** _MIPS_SIM == _ABI64 (= 3) Abi: -64 on IRIX 6.2 395 ** 396 ** _MIPS_SIM is 1 also on IRIX 5.3 397 ** 398 ** IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>. 399 ** IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>. 400 ** Adaptive changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>. 401 */ 402 403 #if defined(__sgi) 404 # ifndef IRIX 405 # define IRIX 406 # endif /* ! IRIX */ 407 # if _MIPS_SIM > 0 && !defined(IRIX5) 408 # define IRIX5 /* IRIX5 or IRIX6 */ 409 # endif /* _MIPS_SIM > 0 && !defined(IRIX5) */ 410 # if _MIPS_SIM > 1 && !defined(IRIX6) && !defined(IRIX64) 411 # define IRIX6 /* IRIX6 */ 412 # endif /* _MIPS_SIM > 1 && !defined(IRIX6) && !defined(IRIX64) */ 413 #endif /* defined(__sgi) */ 414 415 #ifdef IRIX 416 # define SYSTEM5 1 /* this is a System-V derived system */ 417 # define HASSETREUID 1 /* has setreuid(2) call */ 418 # define HASINITGROUPS 1 /* has initgroups(3) call */ 419 # define HASFCHMOD 1 /* has fchmod(2) syscall */ 420 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 421 # define IP_SRCROUTE 1 /* can check IP source routing */ 422 # define setpgid BSDsetpgrp 423 # define GIDSET_T gid_t 424 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 425 # define SFS_BAVAIL f_bfree /* alternate field name */ 426 # define SYSLOG_BUFSIZE 512 427 # ifdef IRIX6 428 # define STAT64 1 429 # define QUAD_T unsigned long long 430 # define LA_TYPE LA_IRIX6 /* figure out at run time */ 431 # define SAFENFSPATHCONF 0 /* pathconf(2) lies on NFS filesystems */ 432 # else /* IRIX6 */ 433 # define LA_TYPE LA_INT 434 435 # ifdef IRIX64 436 # define STAT64 1 437 # define QUAD_T unsigned long long 438 # define NAMELISTMASK 0x7fffffffffffffff /* mask for nlist() values */ 439 # else /* IRIX64 */ 440 # define STAT64 0 441 # define NAMELISTMASK 0x7fffffff /* mask for nlist() values */ 442 # endif /* IRIX64 */ 443 # endif /* IRIX6 */ 444 # if defined(IRIX64) || defined(IRIX5) || defined(IRIX6) 445 # include <sys/cdefs.h> 446 # include <paths.h> 447 # define ARGV_T char *const * 448 # define HASFCHOWN 1 /* has fchown(2) */ 449 # define HASSETRLIMIT 1 /* has setrlimit(2) syscall */ 450 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) syscall */ 451 # define HASSTRERROR 1 /* has strerror(3) */ 452 # else /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */ 453 # define ARGV_T const char ** 454 # define WAITUNION 1 /* use "union wait" as wait argument type */ 455 # endif /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */ 456 #endif /* IRIX */ 457 458 459 /* 460 ** SunOS and Solaris 461 ** 462 ** Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and 463 ** Solaris 2.4 (a.k.a. SunOS 5.4). 464 */ 465 466 #if defined(sun) && !defined(BSD) 467 468 # include <sys/time.h> 469 # define HASINITGROUPS 1 /* has initgroups(3) call */ 470 # define HASUNAME 1 /* use System V uname(2) system call */ 471 # define HASFCHMOD 1 /* has fchmod(2) syscall */ 472 # define IP_SRCROUTE 1 /* can check IP source routing */ 473 # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */ 474 # ifndef HASFCHOWN 475 # define HASFCHOWN 1 /* fchown(2) */ 476 # endif /* ! HASFCHOWN */ 477 478 # ifdef SOLARIS_2_3 479 # define SOLARIS 20300 /* for back compat only -- use -DSOLARIS=20300 */ 480 # endif /* SOLARIS_2_3 */ 481 482 # if defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4)) 483 # define SOLARIS 1 /* unknown Solaris version */ 484 # endif /* defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4)) */ 485 486 # ifdef SOLARIS 487 /* Solaris 2.x (a.k.a. SunOS 5.x) */ 488 # ifndef __svr4__ 489 # define __svr4__ /* use all System V Release 4 defines below */ 490 # endif /* ! __svr4__ */ 491 # define GIDSET_T gid_t 492 # define USE_SA_SIGACTION 1 /* use sa_sigaction field */ 493 # define HASSTRERROR 1 /* has strerror(3) */ 494 # if _FFR_MILTER 495 # define BROKEN_PTHREAD_SLEEP 1 /* sleep after pthread_create() fails */ 496 # endif /* _FFR_MILTER */ 497 # ifndef _PATH_UNIX 498 # define _PATH_UNIX "/dev/ksyms" 499 # endif /* ! _PATH_UNIX */ 500 # ifndef _PATH_VENDOR_CF 501 # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" 502 # endif /* ! _PATH_VENDOR_CF */ 503 # ifndef _PATH_SENDMAILPID 504 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 505 # endif /* ! _PATH_SENDMAILPID */ 506 # ifndef _PATH_HOSTS 507 # define _PATH_HOSTS "/etc/inet/hosts" 508 # endif /* ! _PATH_HOSTS */ 509 # ifndef SYSLOG_BUFSIZE 510 # define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */ 511 # endif /* ! SYSLOG_BUFSIZE */ 512 # ifndef TZ_TYPE 513 # define TZ_TYPE TZ_TZNAME 514 # endif /* ! TZ_TYPE */ 515 # if SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203) 516 # define USESETEUID 1 /* seteuid works as of 2.3 */ 517 # endif /* SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203) */ 518 # if SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) 519 # define HASSETREUID 1 /* setreuid works as of 2.5 */ 520 # if SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700) 521 # ifndef LA_TYPE 522 # define LA_TYPE LA_KSTAT /* use kstat(3k) -- may work in < 2.5 */ 523 # endif /* ! LA_TYPE */ 524 # ifndef RANDOMSHIFT /* random() doesn't work well (sometimes) */ 525 # define RANDOMSHIFT 8 526 # endif /* RANDOMSHIFT */ 527 # endif /* SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700) */ 528 # else /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */ 529 # ifndef HASRANDOM 530 # define HASRANDOM 0 /* doesn't have random(3) */ 531 # endif /* ! HASRANDOM */ 532 # endif /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */ 533 # if SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) 534 # define HASSNPRINTF 1 /* has snprintf starting in 2.6 */ 535 # else /* SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) */ 536 # if _FFR_MILTER 537 # define SM_INT32 int /* 32bit integer */ 538 # endif /* _FFR_MILTER */ 539 # endif /* SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) */ 540 # if SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) 541 # ifndef LA_TYPE 542 # include <sys/loadavg.h> 543 # if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) 544 # include <sys/pset.h> 545 # define LA_TYPE LA_PSET /* pset_getloadavg(3c) appears in 2.9 */ 546 # else 547 # define LA_TYPE LA_SUBR /* getloadavg(3c) appears in 2.7 */ 548 # endif /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */ 549 # endif /* ! LA_TYPE */ 550 # define HASGETUSERSHELL 1 /* getusershell(3c) bug fixed in 2.7 */ 551 # endif /* SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) */ 552 # if SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) 553 # define HASSTRL 1 /* str*(3) added in 2.8 */ 554 # undef _PATH_SENDMAILPID /* tmpfs /var/run added in 2.8 */ 555 # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 556 # endif /* SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) */ 557 # if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) 558 # define HASURANDOMDEV 1 /* /dev/[u]random added in S9 */ 559 # endif /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */ 560 # ifndef HASGETUSERSHELL 561 # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps pre-2.7 */ 562 # endif /* ! HASGETUSERSHELL */ 563 564 # else /* SOLARIS */ 565 /* SunOS 4.0.3 or 4.1.x */ 566 # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ 567 # define HASSETREUID 1 /* has setreuid(2) call */ 568 # ifndef HASFLOCK 569 # define HASFLOCK 1 /* has flock(2) call */ 570 # endif /* ! HASFLOCK */ 571 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 572 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */ 573 # include <memory.h> 574 # include <vfork.h> 575 # ifdef __GNUC__ 576 # define strtoul strtol /* gcc library bogosity */ 577 # endif /* __GNUC__ */ 578 # define memmove(d, s, l) (bcopy((s), (d), (l))) 579 580 # ifdef SUNOS403 581 /* special tweaking for SunOS 4.0.3 */ 582 # include <malloc.h> 583 # define BSD4_3 1 /* 4.3 BSD-based */ 584 # define NEEDSTRSTR 1 /* need emulation of strstr(3) routine */ 585 # define WAITUNION 1 /* use "union wait" as wait argument type */ 586 # undef WIFEXITED 587 # undef WEXITSTATUS 588 # undef HASUNAME 589 # define setpgid setpgrp 590 # define MODE_T int 591 typedef int pid_t; 592 extern char *getenv(); 593 594 # else /* SUNOS403 */ 595 /* 4.1.x specifics */ 596 # define HASSETSID 1 /* has Posix setsid(2) call */ 597 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 598 599 # endif /* SUNOS403 */ 600 # endif /* SOLARIS */ 601 602 # ifndef LA_TYPE 603 # define LA_TYPE LA_INT 604 # endif /* ! LA_TYPE */ 605 606 #endif /* defined(sun) && !defined(BSD) */ 607 608 /* 609 ** DG/UX 610 ** 611 ** Tested on 5.4.2 and 5.4.3. Use DGUX_5_4_2 to get the 612 ** older support. 613 ** 5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>. 614 */ 615 616 #ifdef DGUX_5_4_2 617 # define DGUX 1 618 #endif /* DGUX_5_4_2 */ 619 620 #ifdef DGUX 621 # define SYSTEM5 1 622 # define LA_TYPE LA_DGUX 623 # define HASSETREUID 1 /* has setreuid(2) call */ 624 # define HASUNAME 1 /* use System V uname(2) system call */ 625 # define HASSETSID 1 /* has Posix setsid(2) call */ 626 # define HASINITGROUPS 1 /* has initgroups(3) call */ 627 # define IP_SRCROUTE 0 /* does not have <netinet/ip_var.h> */ 628 # define HASGETUSERSHELL 0 /* does not have getusershell(3) */ 629 # define HASSNPRINTF 1 /* has snprintf(3) */ 630 # ifndef IDENTPROTO 631 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 632 # endif /* ! IDENTPROTO */ 633 # define SPT_TYPE SPT_NONE /* don't use setproctitle */ 634 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 635 636 /* these include files must be included early on DG/UX */ 637 # include <netinet/in.h> 638 # include <arpa/inet.h> 639 640 /* compiler doesn't understand const? */ 641 # define const 642 643 # ifdef DGUX_5_4_2 644 # define inet_addr dgux_inet_addr 645 extern long dgux_inet_addr(); 646 # endif /* DGUX_5_4_2 */ 647 #endif /* DGUX */ 648 649 650 /* 651 ** Digital Ultrix 4.2A or 4.3 652 ** 653 ** Apparently, fcntl locking is broken on 4.2A, in that locks are 654 ** not dropped when the process exits. This causes major problems, 655 ** so flock is the only alternative. 656 */ 657 658 #ifdef ultrix 659 # define HASSETREUID 1 /* has setreuid(2) call */ 660 # define HASUNSETENV 1 /* has unsetenv(3) call */ 661 # define HASINITGROUPS 1 /* has initgroups(3) call */ 662 # define HASUNAME 1 /* use System V uname(2) system call */ 663 # define HASFCHMOD 1 /* has fchmod(2) syscall */ 664 # define HASFCHOWN 1 /* has fchown(2) syscall */ 665 # ifndef HASFLOCK 666 # define HASFLOCK 1 /* has flock(2) call */ 667 # endif /* ! HASFLOCK */ 668 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 669 # ifndef BROKEN_RES_SEARCH 670 # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ 671 # endif /* ! BROKEN_RES_SEARCH */ 672 # if !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621 673 # define NEEDLOCAL_HOSTNAME_LENGTH 1 /* see sendmail/README */ 674 # endif /* !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621 */ 675 # ifdef vax 676 # define LA_TYPE LA_FLOAT 677 # else /* vax */ 678 # define LA_TYPE LA_INT 679 # define LA_AVENRUN "avenrun" 680 # endif /* vax */ 681 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 682 # ifndef IDENTPROTO 683 # define IDENTPROTO 0 /* pre-4.4 TCP/IP implementation is broken */ 684 # endif /* ! IDENTPROTO */ 685 # define SYSLOG_BUFSIZE 256 686 #endif /* ultrix */ 687 688 689 /* 690 ** OSF/1 for KSR. 691 ** 692 ** Contributed by Todd C. Miller <Todd.Miller@cs.colorado.edu> 693 */ 694 695 #ifdef __ksr__ 696 # define __osf__ 1 /* get OSF/1 defines below */ 697 # ifndef TZ_TYPE 698 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 699 # endif /* ! TZ_TYPE */ 700 #endif /* __ksr__ */ 701 702 703 /* 704 ** OSF/1 for Intel Paragon. 705 ** 706 ** Contributed by Jeff A. Earickson <jeff@ssd.intel.com> 707 ** of Intel Scalable Systems Divison. 708 */ 709 710 #ifdef __PARAGON__ 711 # define __osf__ 1 /* get OSF/1 defines below */ 712 # ifndef TZ_TYPE 713 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 714 # endif /* ! TZ_TYPE */ 715 # define GIDSET_T gid_t 716 # define MAXNAMLEN NAME_MAX 717 #endif /* __PARAGON__ */ 718 719 720 /* 721 ** Tru64 UNIX, formerly known as Digital UNIX, formerly known as DEC OSF/1 722 ** 723 ** Tested for 3.2 and 4.0. 724 */ 725 726 #ifdef __osf__ 727 # define HASUNAME 1 /* has uname(2) call */ 728 # define HASUNSETENV 1 /* has unsetenv(3) call */ 729 # define USESETEUID 1 /* has usable seteuid(2) call */ 730 # define HASINITGROUPS 1 /* has initgroups(3) call */ 731 # define HASFCHMOD 1 /* has fchmod(2) syscall */ 732 # define HASFCHOWN 1 /* has fchown(2) syscall */ 733 # define HASSETLOGIN 1 /* has setlogin(2) */ 734 # define IP_SRCROUTE 1 /* can check IP source routing */ 735 # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ 736 # define GIDSET_T gid_t 737 # if _FFR_MILTER 738 # define SM_INT32 int /* 32bit integer */ 739 # endif /* _FFR_MILTER */ 740 # ifndef HASFLOCK 741 # define HASFLOCK 1 /* has flock(2) call */ 742 # endif /* ! HASFLOCK */ 743 # define LA_TYPE LA_ALPHAOSF 744 # define SFS_TYPE SFS_STATVFS /* use <sys/statvfs.h> statfs() impl */ 745 # ifndef _PATH_VENDOR_CF 746 # define _PATH_VENDOR_CF "/var/adm/sendmail/sendmail.cf" 747 # endif /* ! _PATH_VENDOR_CF */ 748 # ifndef _PATH_SENDMAILPID 749 # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 750 # endif /* ! _PATH_SENDMAILPID */ 751 #endif /* __osf__ */ 752 753 754 /* 755 ** NeXTstep 756 */ 757 758 #ifdef NeXT 759 # define HASINITGROUPS 1 /* has initgroups(3) call */ 760 # define NEEDPUTENV 2 /* need putenv(3) call; no setenv(3) call */ 761 # ifndef HASFLOCK 762 # define HASFLOCK 1 /* has flock(2) call */ 763 # endif /* ! HASFLOCK */ 764 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 765 # define WAITUNION 1 /* use "union wait" as wait argument type */ 766 # define UID_T int /* compiler gripes on uid_t */ 767 # define GID_T int /* ditto for gid_t */ 768 # define MODE_T int /* and mode_t */ 769 # define setpgid setpgrp 770 # ifndef NOT_SENDMAIL 771 # define sleep sleepX 772 # endif /* ! NOT_SENDMAIL */ 773 # ifndef LA_TYPE 774 # define LA_TYPE LA_MACH 775 # endif /* ! LA_TYPE */ 776 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 777 # ifndef _POSIX_SOURCE 778 typedef int pid_t; 779 # undef WEXITSTATUS 780 # undef WIFEXITED 781 # undef WIFSTOPPED 782 # undef WTERMSIG 783 # endif /* ! _POSIX_SOURCE */ 784 # ifndef _PATH_VENDOR_CF 785 # define _PATH_VENDOR_CF "/etc/sendmail/sendmail.cf" 786 # endif /* ! _PATH_VENDOR_CF */ 787 # ifndef _PATH_SENDMAILPID 788 # define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid" 789 # endif /* ! _PATH_SENDMAILPID */ 790 791 # ifdef TCPWRAPPERS 792 # ifndef HASUNSETENV 793 # define HASUNSETENV 1 794 # endif /* ! HASUNSETENV */ 795 # undef NEEDPUTENV 796 # endif /* TCPWRAPPERS */ 797 798 #endif /* NeXT */ 799 800 /* 801 ** Apple Rhapsody 802 ** Contributed by Wilfredo Sanchez <wsanchez@apple.com> 803 ** 804 ** Also used for Apple Darwin support. 805 */ 806 807 #if defined(DARWIN) 808 # define HASFCHMOD 1 /* has fchmod(2) syscall */ 809 # define HASFLOCK 1 /* has flock(2) syscall */ 810 # define HASUNAME 1 /* has uname(2) syscall */ 811 # define HASUNSETENV 1 812 # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ 813 # define HASINITGROUPS 1 814 # define HASSETVBUF 1 815 # define HASSETREUID 1 816 # define USESETEUID 1 /* has usable seteuid(2) call */ 817 # define HASLSTAT 1 818 # define HASSETRLIMIT 1 819 # define HASWAITPID 1 820 # define HASSTRERROR 1 /* has strerror(3) */ 821 # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ 822 # define HASSTRERROR 1 /* has strerror(3) */ 823 # define HASGETDTABLESIZE 1 824 # define HASGETUSERSHELL 1 825 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 826 # define BSD4_4_SOCKADDR /* has sa_len */ 827 # define NETLINK 1 /* supports AF_LINK */ 828 # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ 829 # define GIDSET_T gid_t 830 # define LA_TYPE LA_SUBR /* use getloadavg(3) */ 831 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 832 # define SPT_TYPE SPT_PSSTRINGS 833 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 834 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 835 #endif /* DARWIN */ 836 837 838 /* 839 ** 4.4 BSD 840 ** 841 ** See also BSD defines. 842 */ 843 844 #if defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) 845 # include <paths.h> 846 # define HASUNSETENV 1 /* has unsetenv(3) call */ 847 # define USESETEUID 1 /* has usable seteuid(2) call */ 848 # define HASFCHMOD 1 /* has fchmod(2) syscall */ 849 # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ 850 # define HASSTRERROR 1 /* has strerror(3) */ 851 # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ 852 # include <sys/cdefs.h> 853 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 854 # define BSD4_4_SOCKADDR /* has sa_len */ 855 # define NEED_PRINTF_PERCENTQ 1 /* doesn't have %lld */ 856 # define NETLINK 1 /* supports AF_LINK */ 857 # ifndef LA_TYPE 858 # define LA_TYPE LA_SUBR 859 # endif /* ! LA_TYPE */ 860 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 861 # define SPT_TYPE SPT_PSSTRINGS /* use PS_STRINGS pointer */ 862 #endif /* defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) */ 863 864 865 /* 866 ** BSD/OS (was BSD/386) (all versions) 867 ** From Tony Sanders, BSDI 868 */ 869 870 #ifdef __bsdi__ 871 # include <paths.h> 872 # define HASUNSETENV 1 /* has the unsetenv(3) call */ 873 # define HASSETREUID 0 /* BSD-OS has broken setreuid(2) emulation */ 874 # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ 875 # define USESETEUID 1 /* has usable seteuid(2) call */ 876 # define HASFCHMOD 1 /* has fchmod(2) syscall */ 877 # define HASFCHOWN 1 /* has fchown(2) syscall */ 878 # define HASSETLOGIN 1 /* has setlogin(2) */ 879 # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ 880 # define HASUNAME 1 /* has uname(2) syscall */ 881 # define HASSTRERROR 1 /* has strerror(3) */ 882 # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ 883 # include <sys/cdefs.h> 884 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 885 # define BSD4_4_SOCKADDR /* has sa_len */ 886 # define NETLINK 1 /* supports AF_LINK */ 887 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 888 # ifndef LA_TYPE 889 # define LA_TYPE LA_SUBR 890 # endif /* ! LA_TYPE */ 891 # define GIDSET_T gid_t 892 # define QUAD_T quad_t 893 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 894 /* version 1.1 or later */ 895 # undef SPT_TYPE 896 # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ 897 # else /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */ 898 /* version 1.0 or earlier */ 899 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 900 # endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */ 901 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 /* on 3.x */ 902 # define HASSETUSERCONTEXT 1 /* has setusercontext */ 903 # endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 */ 904 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910 /* on 4.x */ 905 # define HASURANDOMDEV 1 /* has /dev/urandom(4) */ 906 # endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910 */ 907 #endif /* __bsdi__ */ 908 909 910 /* 911 ** QNX 4.2x 912 ** Contributed by Glen McCready <glen@qnx.com>. 913 ** 914 ** Should work with all versions of QNX. 915 */ 916 917 #if defined(__QNX__) 918 # include <unix.h> 919 # include <sys/select.h> 920 # undef NGROUPS_MAX 921 # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ 922 # define USESETEUID 1 /* has usable seteuid(2) call */ 923 # define HASFCHMOD 1 /* has fchmod(2) syscall */ 924 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 925 # define HASSETREUID 1 /* has setreuid(2) call */ 926 # define HASSTRERROR 1 /* has strerror(3) */ 927 # define HASFLOCK 0 928 # undef HASINITGROUPS /* has initgroups(3) call */ 929 # define NEEDGETOPT 1 /* use sendmail's getopt */ 930 # define IP_SRCROUTE 1 /* can check IP source routing */ 931 # define TZ_TYPE TZ_TMNAME /* use tmname variable */ 932 # define GIDSET_T gid_t 933 # define LA_TYPE LA_ZERO 934 # define SFS_TYPE SFS_NONE 935 # define SPT_TYPE SPT_REUSEARGV 936 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 937 # define HASGETUSERSHELL 0 938 # define E_PSEUDOBASE 512 939 # define _FILE_H_INCLUDED 940 #endif /* defined(__QNX__) */ 941 942 943 /* 944 ** FreeBSD / NetBSD / OpenBSD (all architectures, all versions) 945 ** 946 ** 4.3BSD clone, closer to 4.4BSD for FreeBSD 1.x and NetBSD 0.9x 947 ** 4.4BSD-Lite based for FreeBSD 2.x and NetBSD 1.x 948 ** 949 ** See also BSD defines. 950 */ 951 952 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) 953 # include <paths.h> 954 # define HASUNSETENV 1 /* has unsetenv(3) call */ 955 # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ 956 # define USESETEUID 1 /* has usable seteuid(2) call */ 957 # define HASFCHMOD 1 /* has fchmod(2) syscall */ 958 # define HASFCHOWN 1 /* fchown(2) */ 959 # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ 960 # define HASUNAME 1 /* has uname(2) syscall */ 961 # define HASSTRERROR 1 /* has strerror(3) */ 962 # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ 963 # define NEED_PRINTF_PERCENTQ 1 /* doesn't have %lld */ 964 # include <sys/cdefs.h> 965 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 966 # define BSD4_4_SOCKADDR /* has sa_len */ 967 # define NETLINK 1 /* supports AF_LINK */ 968 # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */ 969 # define GIDSET_T gid_t 970 # define QUAD_T unsigned long long 971 # define SFIO_STDIO_COMPAT 1 /* can use RES_DEBUG */ 972 # ifndef LA_TYPE 973 # define LA_TYPE LA_SUBR 974 # endif /* ! LA_TYPE */ 975 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 976 # if defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1) 977 # undef SPT_TYPE 978 # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ 979 # endif /* defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1) */ 980 # if defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3)) 981 # define HASURANDOMDEV 1 /* has /dev/urandom(4) */ 982 # endif /* defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3)) */ 983 # if defined(__FreeBSD__) 984 # define HASSETLOGIN 1 /* has setlogin(2) */ 985 # if __FreeBSD_version >= 227001 986 # define HASSRANDOMDEV 1 /* has srandomdev(3) */ 987 # define HASURANDOMDEV 1 /* has /dev/urandom(4) */ 988 # endif /* __FreeBSD_version >= 227001 */ 989 # undef SPT_TYPE 990 # if __FreeBSD__ >= 2 991 # include <osreldate.h> 992 # if __FreeBSD_version >= 199512 /* 2.2-current when it appeared */ 993 # include <libutil.h> 994 # define SPT_TYPE SPT_BUILTIN 995 # endif /* __FreeBSD_version >= 199512 */ 996 # if __FreeBSD_version >= 222000 /* 2.2.2-release and later */ 997 # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */ 998 # endif /* __FreeBSD_version >= 222000 */ 999 # if __FreeBSD_version >= 330000 /* 3.3.0-release and later */ 1000 # ifndef HASSTRL 1001 # define HASSTRL 1 /* has strlc{py,at}(3) functions */ 1002 # endif /* HASSTRL */ 1003 # endif /* __FreeBSD_version >= 330000 */ 1004 # define USESYSCTL 1 /* use sysctl(3) for getting ncpus */ 1005 # include <sys/sysctl.h> 1006 # endif /* __FreeBSD__ >= 2 */ 1007 # ifndef SPT_TYPE 1008 # define SPT_TYPE SPT_REUSEARGV 1009 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 1010 # endif /* ! SPT_TYPE */ 1011 # endif /* defined(__FreeBSD__) */ 1012 # if defined(__OpenBSD__) 1013 # undef SPT_TYPE 1014 # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ 1015 # define HASSETLOGIN 1 /* has setlogin(2) */ 1016 # define HASSETREUID 0 /* OpenBSD has broken setreuid(2) emulation */ 1017 # define HASURANDOMDEV 1 /* has /dev/urandom(4) */ 1018 # if OpenBSD < 199912 1019 # define HASSTRL 0 /* strlcat(3) is broken in 2.5 and earlier */ 1020 # else /* OpenBSD < 199912 */ 1021 # define HASSTRL 1 /* has strlc{py,at}(3) functions */ 1022 # if OpenBSD >= 200006 1023 # define HASSRANDOMDEV 1 /* has srandomdev(3) */ 1024 # endif 1025 # if OpenBSD >= 200012 1026 # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */ 1027 # endif 1028 # endif /* OpenBSD < 199912 */ 1029 # endif /* defined(__OpenBSD__) */ 1030 #endif /* defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */ 1031 1032 1033 /* 1034 ** Mach386 1035 ** 1036 ** For mt Xinu's Mach386 system. 1037 */ 1038 1039 #if defined(MACH) && defined(i386) && !defined(__GNU__) 1040 # define MACH386 1 1041 # define HASUNSETENV 1 /* has unsetenv(3) call */ 1042 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1043 # ifndef HASFLOCK 1044 # define HASFLOCK 1 /* has flock(2) call */ 1045 # endif /* ! HASFLOCK */ 1046 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 1047 # define NEEDSTRTOL 1 /* need the strtol() function */ 1048 # define setpgid setpgrp 1049 # ifndef LA_TYPE 1050 # define LA_TYPE LA_FLOAT 1051 # endif /* ! LA_TYPE */ 1052 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 1053 # undef HASSETVBUF /* don't actually have setvbuf(3) */ 1054 # undef WEXITSTATUS 1055 # undef WIFEXITED 1056 # ifndef _PATH_VENDOR_CF 1057 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1058 # endif /* ! _PATH_VENDOR_CF */ 1059 # ifndef _PATH_SENDMAILPID 1060 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 1061 # endif /* ! _PATH_SENDMAILPID */ 1062 #endif /* defined(MACH) && defined(i386) && !defined(__GNU__) */ 1063 1064 1065 1066 /* 1067 ** GNU OS (hurd) 1068 ** Largely BSD & posix compatible. 1069 ** Port contributed by Miles Bader <miles@gnu.ai.mit.edu>. 1070 ** Updated by Mark Kettenis <kettenis@wins.uva.nl>. 1071 */ 1072 1073 #if defined(__GNU__) && !defined(NeXT) 1074 # include <paths.h> 1075 # define HASFCHMOD 1 /* has fchmod(2) call */ 1076 # define HASFCHOWN 1 /* has fchown(2) call */ 1077 # define HASUNAME 1 /* has uname(2) call */ 1078 # define HASUNSETENV 1 /* has unsetenv(3) call */ 1079 # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ 1080 # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ 1081 # define HASSTRERROR 1 /* has strerror(3) */ 1082 # define GIDSET_T gid_t 1083 # define SOCKADDR_LEN_T socklen_t 1084 # define SOCKOPT_LEN_T socklen_t 1085 # if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 1086 # define LA_TYPE LA_SUBR 1087 # else 1088 # define LA_TYPE LA_MACH 1089 /* GNU uses mach[34], which renames some rpcs from mach2.x. */ 1090 # define host_self mach_host_self 1091 # endif 1092 # define SFS_TYPE SFS_STATFS 1093 # define SPT_TYPE SPT_CHANGEARGV 1094 # define ERRLIST_PREDEFINED 1 /* don't declare sys_errlist */ 1095 # define BSD4_4_SOCKADDR 1 /* has sa_len */ 1096 # define SIOCGIFCONF_IS_BROKEN 1 /* SIOCGFCONF doesn't work */ 1097 # define HAS_IN_H 1 /* GNU has netinet/in.h. */ 1098 /* GNU has no MAXPATHLEN; ideally the code should be changed to not use it. */ 1099 # define MAXPATHLEN 2048 1100 #endif /* defined(__GNU__) && !defined(NeXT) */ 1101 1102 /* 1103 ** 4.3 BSD -- this is for very old systems 1104 ** 1105 ** Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1. 1106 ** 1107 ** You'll also have to install a new resolver library. 1108 ** I don't guarantee that support for this environment is complete. 1109 */ 1110 1111 #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) 1112 # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 1113 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 1114 # define ARBPTR_T char * 1115 # define setpgid setpgrp 1116 # ifndef LA_TYPE 1117 # define LA_TYPE LA_FLOAT 1118 # endif /* ! LA_TYPE */ 1119 # ifndef _PATH_VENDOR_CF 1120 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1121 # endif /* ! _PATH_VENDOR_CF */ 1122 # ifndef IDENTPROTO 1123 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 1124 # endif /* ! IDENTPROTO */ 1125 # undef WEXITSTATUS 1126 # undef WIFEXITED 1127 typedef short pid_t; 1128 #endif /* defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) */ 1129 1130 1131 /* 1132 ** SCO Unix 1133 ** 1134 ** This includes three parts: 1135 ** 1136 ** The first is for SCO OpenServer 5. 1137 ** (Contributed by Keith Reynolds <keithr@sco.COM>). 1138 ** 1139 ** SCO OpenServer 5 has a compiler version number macro, 1140 ** which we can use to figure out what version we're on. 1141 ** This may have to change in future releases. 1142 ** 1143 ** The second is for SCO UNIX 3.2v4.2/Open Desktop 3.0. 1144 ** (Contributed by Philippe Brand <phb@colombo.telesys-innov.fr>). 1145 ** 1146 ** The third is for SCO UNIX 3.2v4.0/Open Desktop 2.0 and earlier. 1147 */ 1148 1149 /* SCO OpenServer 5 */ 1150 #if _SCO_DS >= 1 1151 # include <paths.h> 1152 # define SIOCGIFNUM_IS_BROKEN 1 /* SIOCGIFNUM returns bogus value */ 1153 # define HASSNPRINTF 1 /* has snprintf(3) call */ 1154 # define HASFCHMOD 1 /* has fchmod(2) call */ 1155 # define HASFCHOWN 1 /* has fchown(2) call */ 1156 # define HASSETRLIMIT 1 /* has setrlimit(2) call */ 1157 # define USESETEUID 1 /* has seteuid(2) call */ 1158 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1159 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 1160 # define RLIMIT_NEEDS_SYS_TIME_H 1 1161 # ifndef LA_TYPE 1162 # define LA_TYPE LA_DEVSHORT 1163 # endif /* ! LA_TYPE */ 1164 # define _PATH_AVENRUN "/dev/table/avenrun" 1165 # ifndef _SCO_unix_4_2 1166 # define _SCO_unix_4_2 1167 # else /* ! _SCO_unix_4_2 */ 1168 # define SOCKADDR_LEN_T size_t /* e.g., arg#3 to accept, getsockname */ 1169 # define SOCKOPT_LEN_T size_t /* arg#5 to getsockopt */ 1170 # endif /* ! _SCO_unix_4_2 */ 1171 #endif /* _SCO_DS >= 1 */ 1172 1173 /* SCO UNIX 3.2v4.2/Open Desktop 3.0 */ 1174 #ifdef _SCO_unix_4_2 1175 # define _SCO_unix_ 1176 # define HASSETREUID 1 /* has setreuid(2) call */ 1177 #endif /* _SCO_unix_4_2 */ 1178 1179 /* SCO UNIX 3.2v4.0 Open Desktop 2.0 and earlier */ 1180 #ifdef _SCO_unix_ 1181 # include <sys/stream.h> /* needed for IP_SRCROUTE */ 1182 # define SYSTEM5 1 /* include all the System V defines */ 1183 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 1184 # define NOFTRUNCATE 0 /* has (simulated) ftruncate call */ 1185 # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */ 1186 # define MAXPATHLEN PATHSIZE 1187 # define SFS_TYPE SFS_4ARGS /* use <sys/statfs.h> 4-arg impl */ 1188 # define SFS_BAVAIL f_bfree /* alternate field name */ 1189 # define SPT_TYPE SPT_SCO /* write kernel u. area */ 1190 # define TZ_TYPE TZ_TM_NAME /* use tm->tm_name */ 1191 # define UID_T uid_t 1192 # define GID_T gid_t 1193 # define GIDSET_T gid_t 1194 # define _PATH_UNIX "/unix" 1195 # ifndef _PATH_VENDOR_CF 1196 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1197 # endif /* ! _PATH_VENDOR_CF */ 1198 # ifndef _PATH_SENDMAILPID 1199 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 1200 # endif /* ! _PATH_SENDMAILPID */ 1201 1202 /* stuff fixed in later releases */ 1203 # ifndef _SCO_unix_4_2 1204 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 1205 # endif /* ! _SCO_unix_4_2 */ 1206 1207 # ifndef _SCO_DS 1208 # define ftruncate chsize /* use chsize(2) to emulate ftruncate */ 1209 # define NEEDFSYNC 1 /* needs the fsync(2) call stub */ 1210 # define NETUNIX 0 /* no unix domain socket support */ 1211 # define LA_TYPE LA_SHORT 1212 # endif /* ! _SCO_DS */ 1213 1214 #endif /* _SCO_unix_ */ 1215 1216 1217 /* 1218 ** ISC (SunSoft) Unix. 1219 ** 1220 ** Contributed by J.J. Bailey <jjb@jagware.bcc.com> 1221 */ 1222 1223 #ifdef ISC_UNIX 1224 # include <net/errno.h> 1225 # include <sys/stream.h> /* needed for IP_SRCROUTE */ 1226 # include <sys/bsdtypes.h> 1227 # define SYSTEM5 1 /* include all the System V defines */ 1228 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 1229 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 1230 # define HASSETREUID 1 /* has setreuid(2) call */ 1231 # define NEEDFSYNC 1 /* needs the fsync(2) call stub */ 1232 # define NETUNIX 0 /* no unix domain socket support */ 1233 # define MAXPATHLEN 1024 1234 # define LA_TYPE LA_SHORT 1235 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 1236 # define SFS_BAVAIL f_bfree /* alternate field name */ 1237 # define _PATH_UNIX "/unix" 1238 # ifndef _PATH_VENDOR_CF 1239 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1240 # endif /* ! _PATH_VENDOR_CF */ 1241 # ifndef _PATH_SENDMAILPID 1242 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 1243 # endif /* ! _PATH_SENDMAILPID */ 1244 #endif /* ISC_UNIX */ 1245 1246 1247 /* 1248 ** Altos System V (5.3.1) 1249 ** Contributed by Tim Rice <tim@trr.metro.net>. 1250 */ 1251 1252 #ifdef ALTOS_SYSTEM_V 1253 # include <sys/stream.h> 1254 # include <limits.h> 1255 # define SYSTEM5 1 /* include all the System V defines */ 1256 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 1257 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 1258 # define WAITUNION 1 /* use "union wait" as wait argument type */ 1259 # define NEEDFSYNC 1 /* no fsync(2) in system library */ 1260 # define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */ 1261 # define NOFTRUNCATE 1 /* do not have ftruncate(2) */ 1262 # define MAXPATHLEN PATH_MAX 1263 # define LA_TYPE LA_SHORT 1264 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 1265 # define SFS_BAVAIL f_bfree /* alternate field name */ 1266 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 1267 # define NETUNIX 0 /* no unix domain socket support */ 1268 # undef WIFEXITED 1269 # undef WEXITSTATUS 1270 # define strtoul strtol /* gcc library bogosity */ 1271 1272 typedef unsigned short uid_t; 1273 typedef unsigned short gid_t; 1274 typedef short pid_t; 1275 typedef unsigned long mode_t; 1276 1277 /* some stuff that should have been in the include files */ 1278 extern char *malloc(); 1279 extern struct passwd *getpwent(); 1280 extern struct passwd *getpwnam(); 1281 extern struct passwd *getpwuid(); 1282 extern char *getenv(); 1283 extern struct group *getgrgid(); 1284 extern struct group *getgrnam(); 1285 1286 #endif /* ALTOS_SYSTEM_V */ 1287 1288 1289 /* 1290 ** ConvexOS 11.0 and later 1291 ** 1292 ** "Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this 1293 ** works on 9.1 as well. 1294 ** 1295 ** ConvexOS 11.5 and later, should work on 11.0 as defined. 1296 ** For pre-ConvexOOS 11.0, define NEEDGETOPT, undef IDENTPROTO 1297 ** 1298 ** Eric Schnoebelen (eric@cirr.com) For CONVEX Computer Corp. 1299 ** (now the CONVEX Technologies Center of Hewlett Packard) 1300 */ 1301 1302 #ifdef _CONVEX_SOURCE 1303 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) */ 1304 # define HASINITGROUPS 1 /* has initgroups(3) */ 1305 # define HASUNAME 1 /* use System V uname(2) system call */ 1306 # define HASSETSID 1 /* has POSIX setsid(2) call */ 1307 # define HASUNSETENV 1 /* has unsetenv(3) */ 1308 # define HASFLOCK 1 /* has flock(2) */ 1309 # define HASSETRLIMIT 1 /* has setrlimit(2) */ 1310 # define HASSETREUID 1 /* has setreuid(2) */ 1311 # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_error=0 */ 1312 # define NEEDPUTENV 1 /* needs putenv (written in terms of setenv) */ 1313 # define NEEDGETOPT 0 /* need replacement for getopt(3) */ 1314 # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ 1315 # define LA_TYPE LA_FLOAT 1316 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 1317 # ifndef _PATH_VENDOR_CF 1318 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1319 # endif /* ! _PATH_VENDOR_CF */ 1320 # ifndef S_IREAD 1321 # define S_IREAD _S_IREAD 1322 # define S_IWRITE _S_IWRITE 1323 # define S_IEXEC _S_IEXEC 1324 # define S_IFMT _S_IFMT 1325 # define S_IFCHR _S_IFCHR 1326 # define S_IFBLK _S_IFBLK 1327 # endif /* ! S_IREAD */ 1328 # ifndef TZ_TYPE 1329 # define TZ_TYPE TZ_TIMEZONE 1330 # endif /* ! TZ_TYPE */ 1331 # ifndef IDENTPROTO 1332 # define IDENTPROTO 1 1333 # endif /* ! IDENTPROTO */ 1334 # ifndef SHARE_V1 1335 # define SHARE_V1 1 /* version 1 of the fair share scheduler */ 1336 # endif /* ! SHARE_V1 */ 1337 # if !defined(__GNUC__ ) 1338 # define UID_T int /* GNUC gets it right, ConvexC botches */ 1339 # define GID_T int /* GNUC gets it right, ConvexC botches */ 1340 # endif /* !defined(__GNUC__ ) */ 1341 # if SECUREWARE 1342 # define FORK fork /* SecureWare wants the real fork! */ 1343 # else /* SECUREWARE */ 1344 # define FORK vfork /* the rest of the OS versions don't care */ 1345 # endif /* SECUREWARE */ 1346 #endif /* _CONVEX_SOURCE */ 1347 1348 1349 /* 1350 ** RISC/os 4.52 1351 ** 1352 ** Gives a ton of warning messages, but otherwise compiles. 1353 */ 1354 1355 #ifdef RISCOS 1356 1357 # define HASUNSETENV 1 /* has unsetenv(3) call */ 1358 # ifndef HASFLOCK 1359 # define HASFLOCK 1 /* has flock(2) call */ 1360 # endif /* ! HASFLOCK */ 1361 # define WAITUNION 1 /* use "union wait" as wait argument type */ 1362 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 1363 # define NEEDPUTENV 1 /* need putenv(3) call */ 1364 # define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */ 1365 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 1366 # define LA_TYPE LA_INT 1367 # define LA_AVENRUN "avenrun" 1368 # define _PATH_UNIX "/unix" 1369 # undef WIFEXITED 1370 1371 # define setpgid setpgrp 1372 1373 typedef int pid_t; 1374 # define SIGFUNC_DEFINED 1375 # define SIGFUNC_RETURN (0) 1376 # define SIGFUNC_DECL int 1377 typedef int (*sigfunc_t)(); 1378 extern char *getenv(); 1379 extern void *malloc(); 1380 1381 /* added for RISC/os 4.01...which is dumber than 4.50 */ 1382 # ifdef RISCOS_4_0 1383 # ifndef ARBPTR_T 1384 # define ARBPTR_T char * 1385 # endif /* ! ARBPTR_T */ 1386 # undef HASFLOCK 1387 # define HASFLOCK 0 1388 # endif /* RISCOS_4_0 */ 1389 1390 # include <sys/time.h> 1391 1392 #endif /* RISCOS */ 1393 1394 1395 /* 1396 ** Linux 0.99pl10 and above... 1397 ** 1398 ** Thanks to, in reverse order of contact: 1399 ** 1400 ** John Kennedy <warlock@csuchico.edu> 1401 ** Andrew Pam <avatar@aus.xanadu.com> 1402 ** Florian La Roche <rzsfl@rz.uni-sb.de> 1403 ** Karl London <karl@borg.demon.co.uk> 1404 ** 1405 ** Last compiled against: [07/21/98 @ 11:47:34 AM (Tuesday)] 1406 ** sendmail 8.9.1 bind-8.1.2 db-2.4.14 1407 ** gcc-2.8.1 glibc-2.0.94 linux-2.1.109 1408 ** 1409 ** NOTE: Override HASFLOCK as you will but, as of 1.99.6, mixed-style 1410 ** file locking is no longer allowed. In particular, make sure 1411 ** your DBM library and sendmail are both using either flock(2) 1412 ** *or* fcntl(2) file locking, but not both. 1413 */ 1414 1415 #ifdef __linux__ 1416 # include <linux/version.h> 1417 # if !defined(KERNEL_VERSION) /* not defined in 2.0.x kernel series */ 1418 # define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) 1419 # endif /* KERNEL_VERSION */ 1420 # define BSD 1 /* include BSD defines */ 1421 # define USESETEUID 0 /* Have it due to POSIX, but doesn't work */ 1422 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 1423 # define HASUNAME 1 /* use System V uname(2) system call */ 1424 # define HASUNSETENV 1 /* has unsetenv(3) call */ 1425 # ifndef HASSNPRINTF 1426 # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ 1427 # endif /* ! HASSNPRINTF */ 1428 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 1429 # define GIDSET_T gid_t /* from <linux/types.h> */ 1430 # define HASGETUSERSHELL 0 /* getusershell(3) broken in Slackware 2.0 */ 1431 # ifndef IP_SRCROUTE 1432 # define IP_SRCROUTE 0 /* linux <= 1.2.8 doesn't support IP_OPTIONS */ 1433 # endif /* ! IP_SRCROUTE */ 1434 # ifndef HAS_IN_H 1435 # define HAS_IN_H 1 /* use netinet/in.h */ 1436 # endif /* ! HAS_IN_H */ 1437 # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */ 1438 # ifndef HASFLOCK 1439 # if LINUX_VERSION_CODE < 66399 1440 # define HASFLOCK 0 /* flock(2) is broken after 0.99.13 */ 1441 # else /* LINUX_VERSION_CODE < 66399 */ 1442 # define HASFLOCK 1 /* flock(2) fixed after 1.3.95 */ 1443 # endif /* LINUX_VERSION_CODE < 66399 */ 1444 # endif /* ! HASFLOCK */ 1445 # ifndef LA_TYPE 1446 # define LA_TYPE LA_PROCSTR 1447 # endif /* ! LA_TYPE */ 1448 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() impl */ 1449 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 1450 # if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0)) 1451 # ifndef HASURANDOMDEV 1452 # define HASURANDOMDEV 1 /* 2.0 (at least) has linux/drivers/char/random.c */ 1453 # endif /* ! HASURANDOMDEV */ 1454 # endif /* LINUX_VERSION_CODE */ 1455 # ifndef TZ_TYPE 1456 # define TZ_TYPE TZ_NONE /* no standard for Linux */ 1457 # endif /* ! TZ_TYPE */ 1458 # ifndef _PATH_SENDMAILPID 1459 # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 1460 # endif /* ! _PATH_SENDMAILPID */ 1461 # include <sys/sysmacros.h> 1462 # undef atol /* wounded in <stdlib.h> */ 1463 # if NETINET6 1464 /* 1465 ** Linux doesn't have a good way to tell userland what interfaces are 1466 ** IPv6-capable. Therefore, the BIND resolver can not determine if there 1467 ** are IPv6 interfaces to honor AI_ADDRCONFIG. Unfortunately, it assumes 1468 ** that none are present. (Excuse the macro name ADDRCONFIG_IS_BROKEN.) 1469 */ 1470 # define ADDRCONFIG_IS_BROKEN 1 1471 1472 /* 1473 ** Indirectly included from glibc's <feature.h>. IPv6 support is native 1474 ** in 2.1 and later, but the APIs appear before the functions. 1475 */ 1476 # if defined(__GLIBC__) && defined(__GLIBC_MINOR__) 1477 # define GLIBC_VERSION ((__GLIBC__ << 8) + __GLIBC_MINOR__) 1478 # if (GLIBC_VERSION >= 0x201) 1479 # undef IPPROTO_ICMPV6 /* linux #defines, glibc enums */ 1480 # else /* (GLIBC_VERSION >= 0x201) */ 1481 # include <linux/in6.h> /* IPv6 support */ 1482 # endif /* (GLIBC_VERSION >= 0x201) */ 1483 # if (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE)) 1484 /* Have APIs in <netdb.h>, but no support in glibc */ 1485 # define NEEDSGETIPNODE 1 1486 # endif /* (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE)) */ 1487 # undef GLIBC_VERSION 1488 # endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */ 1489 # endif /* NETINET6 */ 1490 # ifndef HASFCHOWN 1491 # define HASFCHOWN 1 /* fchown(2) */ 1492 # endif /* ! HASFCHOWN */ 1493 #endif /* __linux__ */ 1494 1495 1496 /* 1497 ** DELL SVR4 Issue 2.2, and others 1498 ** From Kimmo Suominen <kim@grendel.lut.fi> 1499 ** 1500 ** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__ 1501 ** defined, and the definitions conflict. 1502 ** 1503 ** Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid 1504 ** trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A 1505 ** (SVR4.0/386 version 3.0). 1506 */ 1507 1508 #ifdef DELL_SVR4 1509 /* no changes necessary */ 1510 /* see general __svr4__ defines below */ 1511 #endif /* DELL_SVR4 */ 1512 1513 1514 /* 1515 ** Apple A/UX 3.0 1516 */ 1517 1518 #ifdef _AUX_SOURCE 1519 # include <sys/sysmacros.h> 1520 # define BSD /* has BSD routines */ 1521 # define HASSETRLIMIT 0 /* ... but not setrlimit(2) */ 1522 # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ 1523 # define BOGUS_O_EXCL 1 /* exclusive open follows symlinks */ 1524 # define HASUNAME 1 /* use System V uname(2) system call */ 1525 # define HASFCHMOD 1 /* has fchmod(2) syscall */ 1526 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1527 # define HASSETVBUF 1 /* has setvbuf(3) in libc */ 1528 # define HASSTRERROR 1 /* has strerror(3) */ 1529 # define SIGFUNC_DEFINED /* sigfunc_t already defined */ 1530 # define SIGFUNC_RETURN /* POSIX-mode */ 1531 # define SIGFUNC_DECL void /* POSIX-mode */ 1532 # define ERRLIST_PREDEFINED 1 1533 # ifndef IDENTPROTO 1534 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 1535 # endif /* ! IDENTPROTO */ 1536 # ifndef LA_TYPE 1537 # define LA_TYPE LA_INT 1538 # define FSHIFT 16 1539 # endif /* ! LA_TYPE */ 1540 # define LA_AVENRUN "avenrun" 1541 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 1542 # define TZ_TYPE TZ_TZNAME 1543 # ifndef _PATH_UNIX 1544 # define _PATH_UNIX "/unix" /* should be in <paths.h> */ 1545 # endif /* ! _PATH_UNIX */ 1546 # ifndef _PATH_VENDOR_CF 1547 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1548 # endif /* ! _PATH_VENDOR_CF */ 1549 # undef WIFEXITED 1550 # undef WEXITSTATUS 1551 #endif /* _AUX_SOURCE */ 1552 1553 1554 /* 1555 ** Encore UMAX V 1556 ** 1557 ** Not extensively tested. 1558 */ 1559 1560 #ifdef UMAXV 1561 # define HASUNAME 1 /* use System V uname(2) system call */ 1562 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 1563 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1564 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 1565 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 1566 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 1567 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 1568 # define MAXPATHLEN PATH_MAX 1569 extern struct passwd *getpwent(), *getpwnam(), *getpwuid(); 1570 extern struct group *getgrent(), *getgrnam(), *getgrgid(); 1571 # undef WIFEXITED 1572 # undef WEXITSTATUS 1573 #endif /* UMAXV */ 1574 1575 1576 /* 1577 ** Stardent Titan 3000 running TitanOS 4.2. 1578 ** 1579 ** Must be compiled in "cc -43" mode. 1580 ** 1581 ** From Kate Hedstrom <kate@ahab.rutgers.edu>. 1582 ** 1583 ** Note the tweaking below after the BSD defines are set. 1584 */ 1585 1586 #ifdef titan 1587 # define setpgid setpgrp 1588 typedef int pid_t; 1589 # undef WIFEXITED 1590 # undef WEXITSTATUS 1591 #endif /* titan */ 1592 1593 1594 /* 1595 ** Sequent DYNIX 3.2.0 1596 ** 1597 ** From Jim Davis <jdavis@cs.arizona.edu>. 1598 */ 1599 1600 #ifdef sequent 1601 1602 # define BSD 1 1603 # define HASUNSETENV 1 1604 # define BSD4_3 1 /* to get signal() in conf.c */ 1605 # define WAITUNION 1 1606 # define LA_TYPE LA_FLOAT 1607 # ifdef _POSIX_VERSION 1608 # undef _POSIX_VERSION /* set in <unistd.h> */ 1609 # endif /* _POSIX_VERSION */ 1610 # undef HASSETVBUF /* don't actually have setvbuf(3) */ 1611 # define setpgid setpgrp 1612 1613 /* Have to redefine WIFEXITED to take an int, to work with waitfor() */ 1614 # undef WIFEXITED 1615 # define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \ 1616 ((union wait*)&(s))->w_termsig == 0) 1617 # define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode) 1618 typedef int pid_t; 1619 # define isgraph(c) (isprint(c) && (c != ' ')) 1620 1621 # ifndef IDENTPROTO 1622 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 1623 # endif /* ! IDENTPROTO */ 1624 1625 # ifndef _PATH_UNIX 1626 # define _PATH_UNIX "/dynix" 1627 # endif /* ! _PATH_UNIX */ 1628 # ifndef _PATH_VENDOR_CF 1629 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1630 # endif /* ! _PATH_VENDOR_CF */ 1631 #endif /* sequent */ 1632 1633 1634 /* 1635 ** Sequent DYNIX/ptx v2.0 (and higher) 1636 ** 1637 ** For DYNIX/ptx v1.x, undefine HASSETREUID. 1638 ** 1639 ** From Tim Wright <timw@sequent.com>. 1640 ** Update from Jack Woolley <jwoolley@sctcorp.com>, 26 Dec 1995, 1641 ** for DYNIX/ptx 4.0.2. 1642 */ 1643 1644 #ifdef _SEQUENT_ 1645 # include <sys/stream.h> 1646 # define SYSTEM5 1 /* include all the System V defines */ 1647 # define HASSETSID 1 /* has POSIX setsid(2) call */ 1648 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1649 # define HASSETREUID 1 /* has setreuid(2) call */ 1650 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 1651 # define GIDSET_T gid_t 1652 # define LA_TYPE LA_INT 1653 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 1654 # define SPT_TYPE SPT_NONE /* don't use setproctitle */ 1655 # ifndef IDENTPROTO 1656 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 1657 # endif /* ! IDENTPROTO */ 1658 # ifndef _PATH_VENDOR_CF 1659 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1660 # endif /* ! _PATH_VENDOR_CF */ 1661 # ifndef _PATH_SENDMAILPID 1662 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 1663 # endif /* ! _PATH_SENDMAILPID */ 1664 #endif /* _SEQUENT_ */ 1665 1666 1667 /* 1668 ** Cray Unicos 1669 ** 1670 ** Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov> 1671 */ 1672 1673 #ifdef UNICOS 1674 # define SYSTEM5 1 /* include all the System V defines */ 1675 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 1676 # define MAXPATHLEN PATHSIZE 1677 # define LA_TYPE LA_ZERO 1678 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 1679 # define SFS_BAVAIL f_bfree /* alternate field name */ 1680 #endif /* UNICOS */ 1681 1682 1683 /* 1684 ** Apollo DomainOS 1685 ** 1686 ** From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com> 1687 ** 1688 ** 15 Jan 1994; updated 2 Aug 1995 1689 ** 1690 */ 1691 1692 #ifdef apollo 1693 # define HASSETREUID 1 /* has setreuid(2) call */ 1694 # define HASINITGROUPS 1 /* has initgroups(2) call */ 1695 # define IP_SRCROUTE 0 /* does not have <netinet/ip_var.h> */ 1696 # define SPT_TYPE SPT_NONE /* don't use setproctitle */ 1697 # define LA_TYPE LA_SUBR /* use getloadavg.c */ 1698 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 1699 # define SFS_BAVAIL f_bfree /* alternate field name */ 1700 # define TZ_TYPE TZ_TZNAME 1701 # ifndef _PATH_VENDOR_CF 1702 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1703 # endif /* ! _PATH_VENDOR_CF */ 1704 # ifndef _PATH_SENDMAILPID 1705 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 1706 # endif /* ! _PATH_SENDMAILPID */ 1707 # undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */ 1708 # undef S_IFIFO 1709 # define S_IFIFO 0010000 1710 # ifndef IDENTPROTO 1711 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 1712 # endif /* ! IDENTPROTO */ 1713 # define RLIMIT_NEEDS_SYS_TIME_H 1 1714 # if defined(NGROUPS_MAX) && !NGROUPS_MAX 1715 # undef NGROUPS_MAX 1716 # endif /* defined(NGROUPS_MAX) && !NGROUPS_MAX */ 1717 #endif /* apollo */ 1718 1719 /* 1720 ** System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatibility Libs ie. native) 1721 ** 1722 ** Contributed by Paul Gampe <paulg@apnic.net> 1723 */ 1724 1725 #ifdef __svr5__ 1726 # include <sys/mkdev.h> 1727 # define __svr4__ 1728 # define SYS5SIGNALS 1 1729 # define HASFCHOWN 1 /* has fchown(2) call */ 1730 # define HASSETSID 1 1731 # define HASSNPRINTF 1 1732 # define HASSETREUID 1 1733 # define HASWAITPID 1 1734 # define HASGETDTABLESIZE 1 1735 # define GIDSET_T gid_t 1736 # define SOCKADDR_LEN_T size_t 1737 # define SOCKOPT_LEN_T size_t 1738 # ifndef _PATH_UNIX 1739 # define _PATH_UNIX "/stand/unix" 1740 # endif /* ! _PATH_UNIX */ 1741 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 1742 # ifndef SYSLOG_BUFSIZE 1743 # define SYSLOG_BUFSIZE 1024 /* unsure */ 1744 # endif /* SYSLOG_BUFSIZE */ 1745 # ifndef _PATH_VENDOR_CF 1746 # define _PATH_VENDOR_CF "/etc/sendmail.cf" 1747 # endif /* ! _PATH_VENDOR_CF */ 1748 # ifndef _PATH_SENDMAILPID 1749 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 1750 # endif /* ! _PATH_SENDMAILPID */ 1751 # undef offsetof /* avoid stddefs.h, sys/sysmacros.h conflict */ 1752 #if !defined(SM_SET_H_ERRNO) && defined(_REENTRANT) 1753 # define SM_SET_H_ERRNO(err) set_h_errno((err)) 1754 #endif /* ! SM_SET_H_ERRNO && _REENTRANT */ 1755 #endif /* __svr5__ */ 1756 1757 /* ###################################################################### */ 1758 1759 /* 1760 ** UnixWare 2.x 1761 */ 1762 1763 #ifdef UNIXWARE2 1764 # define UNIXWARE 1 1765 # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ 1766 # undef offsetof /* avoid stddefs.h, sys/sysmacros.h conflict */ 1767 #endif /* UNIXWARE2 */ 1768 1769 1770 /* 1771 ** UnixWare 1.1.2. 1772 ** 1773 ** Updated by Petr Lampa <lampa@fee.vutbr.cz>. 1774 ** From Evan Champion <evanc@spatial.synapse.org>. 1775 */ 1776 1777 #ifdef UNIXWARE 1778 # include <sys/mkdev.h> 1779 # define SYSTEM5 1 1780 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 1781 # define HASSETREUID 1 1782 # define HASSETSID 1 1783 # define HASINITGROUPS 1 1784 # define GIDSET_T gid_t 1785 # define SLEEP_T unsigned 1786 # define SFS_TYPE SFS_STATVFS 1787 # define LA_TYPE LA_ZERO 1788 # undef WIFEXITED 1789 # undef WEXITSTATUS 1790 # ifndef _PATH_UNIX 1791 # define _PATH_UNIX "/unix" 1792 # endif /* ! _PATH_UNIX */ 1793 # ifndef _PATH_VENDOR_CF 1794 # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" 1795 # endif /* ! _PATH_VENDOR_CF */ 1796 # ifndef _PATH_SENDMAILPID 1797 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 1798 # endif /* ! _PATH_SENDMAILPID */ 1799 # define SYSLOG_BUFSIZE 128 1800 #endif /* UNIXWARE */ 1801 1802 1803 /* 1804 ** Intergraph CLIX 3.1 1805 ** 1806 ** From Paul Southworth <pauls@locust.cic.net> 1807 */ 1808 1809 #ifdef CLIX 1810 # define SYSTEM5 1 /* looks like System V */ 1811 # ifndef HASGETUSERSHELL 1812 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 1813 # endif /* ! HASGETUSERSHELL */ 1814 # define DEV_BSIZE 512 /* device block size not defined */ 1815 # define GIDSET_T gid_t 1816 # undef LOG /* syslog not available */ 1817 # define NEEDFSYNC 1 /* no fsync in system library */ 1818 # define GETSHORT _getshort 1819 #endif /* CLIX */ 1820 1821 1822 /* 1823 ** NCR MP-RAS 2.x (SysVr4) with Wollongong TCP/IP 1824 ** 1825 ** From Kevin Darcy <kevin@tech.mis.cfc.com>. 1826 */ 1827 1828 #ifdef NCR_MP_RAS2 1829 # include <sys/sockio.h> 1830 # define __svr4__ 1831 # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ 1832 # define SYSLOG_BUFSIZE 1024 1833 # define SPT_TYPE SPT_NONE 1834 #endif /* NCR_MP_RAS2 */ 1835 1836 1837 /* 1838 ** NCR MP-RAS 3.x (SysVr4) with STREAMware TCP/IP 1839 ** 1840 ** From Tom Moore <Tom.Moore@DaytonOH.NCR.COM> 1841 */ 1842 1843 #ifdef NCR_MP_RAS3 1844 # define __svr4__ 1845 # define HASFCHOWN 1 /* has fchown(2) call */ 1846 # define SIOCGIFNUM_IS_BROKEN 1 /* SIOCGIFNUM has non-std interface */ 1847 # define SO_REUSEADDR_IS_BROKEN 1 /* doesn't work if accept() fails */ 1848 # define SYSLOG_BUFSIZE 1024 1849 # define SPT_TYPE SPT_NONE 1850 # ifndef _XOPEN_SOURCE 1851 # define _XOPEN_SOURCE 1852 # define _XOPEN_SOURCE_EXTENDED 1 1853 # include <sys/resource.h> 1854 # undef _XOPEN_SOURCE 1855 # undef _XOPEN_SOURCE_EXTENDED 1856 # endif /* ! _XOPEN_SOURCE */ 1857 #endif /* NCR_MP_RAS3 */ 1858 1859 1860 /* 1861 ** Tandem NonStop-UX SVR4 1862 ** 1863 ** From Rick McCarty <mccarty@mpd.tandem.com>. 1864 */ 1865 1866 #ifdef NonStop_UX_BXX 1867 # define __svr4__ 1868 #endif /* NonStop_UX_BXX */ 1869 1870 1871 /* 1872 ** Hitachi 3050R/3050RX and 3500 Workstations running HI-UX/WE2. 1873 ** 1874 ** Tested for 1.04, 1.03 1875 ** From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>. 1876 ** 1877 ** Tested for 4.02, 6.10 and 7.10 1878 ** From Motonori NAKAMURA <motonori@media.kyoto-u.ac.jp>. 1879 */ 1880 1881 #if !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE)) 1882 # define SYSTEM5 1 /* include all the System V defines */ 1883 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1884 # define HASFCHMOD 1 /* has fchmod(2) syscall */ 1885 # define setreuid(r, e) setresuid(r, e, -1) 1886 # define LA_TYPE LA_FLOAT 1887 # define SPT_TYPE SPT_PSTAT 1888 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 1889 # ifndef HASSETVBUF 1890 # define HASSETVBUF /* HI-UX has no setlinebuf */ 1891 # endif /* ! HASSETVBUF */ 1892 # ifndef GIDSET_T 1893 # define GIDSET_T gid_t 1894 # endif /* ! GIDSET_T */ 1895 # ifndef _PATH_UNIX 1896 # define _PATH_UNIX "/HI-UX" 1897 # endif /* ! _PATH_UNIX */ 1898 # ifndef _PATH_VENDOR_CF 1899 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1900 # endif /* ! _PATH_VENDOR_CF */ 1901 # ifndef IDENTPROTO 1902 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 1903 # endif /* ! IDENTPROTO */ 1904 # ifndef HASGETUSERSHELL 1905 # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ 1906 # endif /* ! HASGETUSERSHELL */ 1907 # define FDSET_CAST (int *) /* cast for fd_set parameters to select */ 1908 1909 /* 1910 ** avoid m_flags conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h 1911 ** on HIUX 3050 1912 */ 1913 # undef m_flags 1914 1915 # ifdef __STDC__ 1916 extern int syslog(int, char *, ...); 1917 # else /* __STDC__ */ 1918 extern int syslog(); 1919 # endif /* __STDC__ */ 1920 1921 #endif /* !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE)) */ 1922 1923 1924 /* 1925 ** Amdahl UTS System V 2.1.5 (SVr3-based) 1926 ** 1927 ** From: Janet Jackson <janet@dialix.oz.au>. 1928 */ 1929 1930 #ifdef _UTS 1931 # include <sys/sysmacros.h> 1932 # undef HASLSTAT /* has symlinks, but they cause problems */ 1933 # define NEEDFSYNC 1 /* system fsync(2) fails on non-EFS filesys */ 1934 # define SYS5SIGNALS 1 /* System V signal semantics */ 1935 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 1936 # define HASUNAME 1 /* use System V uname(2) system call */ 1937 # define HASINITGROUPS 1 /* has initgroups(3) function */ 1938 # define HASSETVBUF 1 /* has setvbuf(3) function */ 1939 # ifndef HASGETUSERSHELL 1940 # define HASGETUSERSHELL 0 /* does not have getusershell(3) function */ 1941 # endif /* ! HASGETUSERSHELL */ 1942 # define GIDSET_T gid_t /* type of 2nd arg to getgroups(2) isn't int */ 1943 # define LA_TYPE LA_ZERO /* doesn't have load average */ 1944 # define SFS_TYPE SFS_4ARGS /* use 4-arg statfs() */ 1945 # define SFS_BAVAIL f_bfree /* alternate field name */ 1946 # define _PATH_UNIX "/unix" 1947 # ifndef _PATH_VENDOR_CF 1948 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1949 # endif /* ! _PATH_VENDOR_CF */ 1950 #endif /* _UTS */ 1951 1952 /* 1953 ** Cray Computer Corporation's CSOS 1954 ** 1955 ** From Scott Bolte <scott@craycos.com>. 1956 */ 1957 1958 #ifdef _CRAYCOM 1959 # define SYSTEM5 1 /* include all the System V defines */ 1960 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 1961 # define NEEDFSYNC 1 /* no fsync in system library */ 1962 # define MAXPATHLEN PATHSIZE 1963 # define LA_TYPE LA_ZERO 1964 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 1965 # define SFS_BAVAIL f_bfree /* alternate field name */ 1966 # define _POSIX_CHOWN_RESTRICTED -1 1967 extern struct group *getgrent(), *getgrnam(), *getgrgid(); 1968 #endif /* _CRAYCOM */ 1969 1970 1971 /* 1972 ** Sony NEWS-OS 4.2.1R and 6.0.3 1973 ** 1974 ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>. 1975 */ 1976 1977 #ifdef sony_news 1978 # ifndef __svr4 1979 /* NEWS-OS 4.2.1R */ 1980 # ifndef BSD 1981 # define BSD /* has BSD routines */ 1982 # endif /* ! BSD */ 1983 # define HASUNSETENV 1 /* has unsetenv(2) call */ 1984 # undef HASSETVBUF /* don't actually have setvbuf(3) */ 1985 # define WAITUNION 1 /* use "union wait" as wait argument type */ 1986 # define LA_TYPE LA_INT 1987 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 1988 # ifndef HASFLOCK 1989 # define HASFLOCK 1 /* has flock(2) call */ 1990 # endif /* ! HASFLOCK */ 1991 # define setpgid setpgrp 1992 # undef WIFEXITED 1993 # undef WEXITSTATUS 1994 # define MODE_T int /* system include files have no mode_t */ 1995 typedef int pid_t; 1996 typedef int (*sigfunc_t)(); 1997 # define SIGFUNC_DEFINED 1998 # define SIGFUNC_RETURN (0) 1999 # define SIGFUNC_DECL int 2000 2001 # else /* ! __svr4 */ 2002 /* NEWS-OS 6.0.3 with /bin/cc */ 2003 # ifndef __svr4__ 2004 # define __svr4__ /* use all System V Release 4 defines below */ 2005 # endif /* ! __svr4__ */ 2006 # define HASSETSID 1 /* has Posix setsid(2) call */ 2007 # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ 2008 # define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */ 2009 # ifndef SPT_TYPE 2010 # define SPT_TYPE SPT_SYSMIPS /* use sysmips() (OS 6.0.2 or later) */ 2011 # endif /* ! SPT_TYPE */ 2012 # define GIDSET_T gid_t 2013 # undef WIFEXITED 2014 # undef WEXITSTATUS 2015 # ifndef SYSLOG_BUFSIZE 2016 # define SYSLOG_BUFSIZE 256 2017 # endif /* ! SYSLOG_BUFSIZE */ 2018 # define _PATH_UNIX "/stand/unix" 2019 # ifndef _PATH_VENDOR_CF 2020 # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" 2021 # endif /* ! _PATH_VENDOR_CF */ 2022 # ifndef _PATH_SENDMAILPID 2023 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 2024 # endif /* ! _PATH_SENDMAILPID */ 2025 2026 # endif /* ! __svr4 */ 2027 #endif /* sony_news */ 2028 2029 2030 /* 2031 ** Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach 2032 ** 2033 ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>. 2034 */ 2035 2036 #ifdef luna 2037 # ifndef IDENTPROTO 2038 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 2039 # endif /* ! IDENTPROTO */ 2040 # define HASUNSETENV 1 /* has unsetenv(2) call */ 2041 # define NEEDPUTENV 1 /* need putenv(3) call */ 2042 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ 2043 # define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */ 2044 # define WAITUNION 1 /* use "union wait" as wait argument type */ 2045 # ifdef uniosb 2046 # include <sys/time.h> 2047 # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 2048 # define LA_TYPE LA_INT 2049 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */ 2050 # endif /* uniosb */ 2051 # ifdef luna2 2052 # define LA_TYPE LA_SUBR 2053 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */ 2054 # endif /* luna2 */ 2055 # ifdef luna88k 2056 # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ 2057 # define LA_TYPE LA_INT 2058 # endif /* luna88k */ 2059 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 2060 # define setpgid setpgrp 2061 # undef WIFEXITED 2062 # undef WEXITSTATUS 2063 typedef int pid_t; 2064 typedef int (*sigfunc_t)(); 2065 # define SIGFUNC_DEFINED 2066 # define SIGFUNC_RETURN (0) 2067 # define SIGFUNC_DECL int 2068 extern char *getenv(); 2069 # ifndef _PATH_VENDOR_CF 2070 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 2071 # endif /* ! _PATH_VENDOR_CF */ 2072 #endif /* luna */ 2073 2074 2075 /* 2076 ** NEC EWS-UX/V 4.2 (with /usr/ucb/cc) 2077 ** 2078 ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>. 2079 */ 2080 2081 #if defined(nec_ews_svr4) || defined(_nec_ews_svr4) 2082 # ifndef __svr4__ 2083 # define __svr4__ /* use all System V Release 4 defines below */ 2084 # endif /* ! __svr4__ */ 2085 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 2086 # define HASSETSID 1 /* has Posix setsid(2) call */ 2087 # define LA_TYPE LA_READKSYM /* use MIOC_READSYM ioctl */ 2088 # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ 2089 # define GIDSET_T gid_t 2090 # undef WIFEXITED 2091 # undef WEXITSTATUS 2092 # define NAMELISTMASK 0x7fffffff /* mask for nlist() values */ 2093 # ifndef _PATH_VENDOR_CF 2094 # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" 2095 # endif /* ! _PATH_VENDOR_CF */ 2096 # ifndef _PATH_SENDMAILPID 2097 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 2098 # endif /* ! _PATH_SENDMAILPID */ 2099 # ifndef SYSLOG_BUFSIZE 2100 # define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */ 2101 # endif /* ! SYSLOG_BUFSIZE */ 2102 #endif /* defined(nec_ews_svr4) || defined(_nec_ews_svr4) */ 2103 2104 2105 /* 2106 ** Fujitsu/ICL UXP/DS (For the DS/90 Series) 2107 ** 2108 ** From Diego R. Lopez <drlopez@cica.es>. 2109 ** Additional changes from Fumio Moriya and Toshiaki Nomura of the 2110 ** Fujitsu Fresoftware group <dsfrsoft@oai6.yk.fujitsu.co.jp>. 2111 */ 2112 2113 #ifdef __uxp__ 2114 # include <arpa/nameser.h> 2115 # include <sys/sysmacros.h> 2116 # include <sys/mkdev.h> 2117 # define __svr4__ 2118 # define HASGETUSERSHELL 0 2119 # define HASFLOCK 0 2120 # if UXPDS == 10 2121 # define HASSNPRINTF 0 /* no snprintf(3) or vsnprintf(3) */ 2122 # else /* UXPDS == 10 */ 2123 # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ 2124 # endif /* UXPDS == 10 */ 2125 # define _PATH_UNIX "/stand/unix" 2126 # ifndef _PATH_VENDOR_CF 2127 # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" 2128 # endif /* ! _PATH_VENDOR_CF */ 2129 # ifndef _PATH_SENDMAILPID 2130 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 2131 # endif /* ! _PATH_SENDMAILPID */ 2132 #endif /* __uxp__ */ 2133 2134 /* 2135 ** Pyramid DC/OSx 2136 ** 2137 ** From Earle Ake <akee@wpdiss1.wpafb.af.mil>. 2138 */ 2139 2140 #ifdef DCOSx 2141 # define GIDSET_T gid_t 2142 # ifndef IDENTPROTO 2143 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 2144 # endif /* ! IDENTPROTO */ 2145 #endif /* DCOSx */ 2146 2147 /* 2148 ** Concurrent Computer Corporation Maxion 2149 ** 2150 ** From Donald R. Laster Jr. <laster@access.digex.net>. 2151 */ 2152 2153 #ifdef __MAXION__ 2154 2155 # include <sys/stream.h> 2156 # define __svr4__ 1 /* SVR4.2MP */ 2157 # define HASSETREUID 1 /* have setreuid(2) */ 2158 # define HASLSTAT 1 /* have lstat(2) */ 2159 # define HASSETRLIMIT 1 /* have setrlimit(2) */ 2160 # define HASGETDTABLESIZE 1 /* have getdtablesize(2) */ 2161 # define HASSNPRINTF 1 /* have snprintf(3) */ 2162 # define HASGETUSERSHELL 1 /* have getusershell(3) */ 2163 # define NOFTRUNCATE 1 /* do not have ftruncate(2) */ 2164 # define SLEEP_T unsigned 2165 # define SFS_TYPE SFS_STATVFS 2166 # define SFS_BAVAIL f_bavail 2167 # ifndef SYSLOG_BUFSIZE 2168 # define SYSLOG_BUFSIZE 256 /* Use 256 bytes */ 2169 # endif /* ! SYSLOG_BUFSIZE */ 2170 2171 # undef WUNTRACED 2172 # undef WIFEXITED 2173 # undef WIFSIGNALED 2174 # undef WIFSTOPPED 2175 # undef WEXITSTATUS 2176 # undef WTERMSIG 2177 # undef WSTOPSIG 2178 2179 #endif /* __MAXION__ */ 2180 2181 /* 2182 ** Harris Nighthawk PowerUX (nh6000 box) 2183 ** 2184 ** Contributed by Bob Miorelli, Pratt & Whitney <miorelli@pweh.com> 2185 */ 2186 2187 #ifdef _PowerUX 2188 # ifndef __svr4__ 2189 # define __svr4__ 2190 # endif /* ! __svr4__ */ 2191 # ifndef _PATH_VENDOR_CF 2192 # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" 2193 # endif /* ! _PATH_VENDOR_CF */ 2194 # ifndef _PATH_SENDMAILPID 2195 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 2196 # endif /* ! _PATH_SENDMAILPID */ 2197 # define SYSLOG_BUFSIZE 1024 2198 # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ 2199 # define LA_TYPE LA_ZERO 2200 typedef struct msgb mblk_t; 2201 # undef offsetof /* avoid stddefs.h and sys/sysmacros.h conflict */ 2202 #endif /* _PowerUX */ 2203 2204 /* 2205 ** Siemens Nixdorf Informationssysteme AG SINIX 2206 ** 2207 ** Contributed by Gerald Rinske <Gerald.Rinske@mch.sni.de> 2208 ** of Siemens Business Services VAS. 2209 */ 2210 #ifdef sinix 2211 # define HASRANDOM 0 /* has random(3) */ 2212 # define SYSLOG_BUFSIZE 1024 2213 #endif /* sinix */ 2214 2215 /* 2216 ** CRAY T3E 2217 ** 2218 ** Contributed by Manu Mahonen <mailadm@csc.fi> 2219 ** of Center for Scientific Computing. 2220 */ 2221 #ifdef _CRAY 2222 # define GET_IPOPT_DST(dst) *(struct in_addr *)&(dst) 2223 #endif /* _CRAY */ 2224 2225 /* 2226 ** Motorola 922, MC88110, UNIX SYSTEM V/88 Release 4.0 Version 4.3 2227 ** 2228 ** Contributed by Sergey Rusanov <rsm@utfoms.udmnet.ru> 2229 */ 2230 2231 #ifdef MOTO 2232 # define HASFCHMOD 1 2233 # define HASSETRLIMIT 0 2234 # define HASSETSID 1 2235 # define HASSETREUID 1 2236 # define HASULIMIT 1 2237 # define HASWAITPID 1 2238 # define HASGETDTABLESIZE 1 2239 # define HASGETUSERSHELL 1 2240 # define IP_SRCROUTE 0 2241 # define IDENTPROTO 0 2242 # define RES_DNSRCH_VARIABLE _res_dnsrch 2243 # define _PATH_UNIX "/unix" 2244 # define _PATH_VENDOR_CF "/etc/sendmail.cf" 2245 # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 2246 #endif /* MOTO */ 2247 2248 2249 /********************************************************************** 2250 ** End of Per-Operating System defines 2251 **********************************************************************/ 2252 /********************************************************************** 2253 ** More general defines 2254 **********************************************************************/ 2255 2256 /* general BSD defines */ 2257 #ifdef BSD 2258 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 2259 # ifndef HASSETREUID 2260 # define HASSETREUID 1 /* has setreuid(2) call */ 2261 # endif /* ! HASSETREUID */ 2262 # define HASINITGROUPS 1 /* has initgroups(3) call */ 2263 # ifndef IP_SRCROUTE 2264 # define IP_SRCROUTE 1 /* can check IP source routing */ 2265 # endif /* ! IP_SRCROUTE */ 2266 # ifndef HASSETRLIMIT 2267 # define HASSETRLIMIT 1 /* has setrlimit(2) call */ 2268 # endif /* ! HASSETRLIMIT */ 2269 # ifndef HASFLOCK 2270 # define HASFLOCK 1 /* has flock(2) call */ 2271 # endif /* ! HASFLOCK */ 2272 # ifndef TZ_TYPE 2273 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone variable */ 2274 # endif /* ! TZ_TYPE */ 2275 #endif /* BSD */ 2276 2277 /* general System V Release 4 defines */ 2278 #ifdef __svr4__ 2279 # define SYSTEM5 1 2280 # define USESETEUID 1 /* has usable seteuid(2) call */ 2281 # define HASINITGROUPS 1 /* has initgroups(3) call */ 2282 # define BSD_COMP 1 /* get BSD ioctl calls */ 2283 # ifndef HASSETRLIMIT 2284 # define HASSETRLIMIT 1 /* has setrlimit(2) call */ 2285 # endif /* ! HASSETRLIMIT */ 2286 # ifndef HASGETUSERSHELL 2287 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 2288 # endif /* ! HASGETUSERSHELL */ 2289 # ifndef HASFCHMOD 2290 # define HASFCHMOD 1 /* most (all?) SVr4s seem to have fchmod(2) */ 2291 # endif /* ! HASFCHMOD */ 2292 2293 # ifndef _PATH_UNIX 2294 # define _PATH_UNIX "/unix" 2295 # endif /* ! _PATH_UNIX */ 2296 # ifndef _PATH_VENDOR_CF 2297 # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" 2298 # endif /* ! _PATH_VENDOR_CF */ 2299 # ifndef _PATH_SENDMAILPID 2300 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 2301 # endif /* ! _PATH_SENDMAILPID */ 2302 # ifndef SYSLOG_BUFSIZE 2303 # define SYSLOG_BUFSIZE 128 2304 # endif /* ! SYSLOG_BUFSIZE */ 2305 # ifndef SFS_TYPE 2306 # define SFS_TYPE SFS_STATVFS 2307 # endif /* ! SFS_TYPE */ 2308 2309 # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */ 2310 #endif /* __svr4__ */ 2311 2312 /* general System V defines */ 2313 #ifdef SYSTEM5 2314 # include <sys/sysmacros.h> 2315 # define HASUNAME 1 /* use System V uname(2) system call */ 2316 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 2317 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 2318 # ifndef HASULIMIT 2319 # define HASULIMIT 1 /* has the ulimit(2) syscall */ 2320 # endif /* ! HASULIMIT */ 2321 # ifndef LA_TYPE 2322 # ifdef MIOC_READKSYM 2323 # define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */ 2324 # else /* MIOC_READKSYM */ 2325 # define LA_TYPE LA_INT /* assume integer load average */ 2326 # endif /* MIOC_READKSYM */ 2327 # endif /* ! LA_TYPE */ 2328 # ifndef SFS_TYPE 2329 # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ 2330 # endif /* ! SFS_TYPE */ 2331 # ifndef TZ_TYPE 2332 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 2333 # endif /* ! TZ_TYPE */ 2334 #endif /* SYSTEM5 */ 2335 2336 /* general POSIX defines */ 2337 #ifdef _POSIX_VERSION 2338 # define HASSETSID 1 /* has Posix setsid(2) call */ 2339 # define HASWAITPID 1 /* has Posix waitpid(2) call */ 2340 # if _POSIX_VERSION >= 199500 && !defined(USESETEUID) 2341 # define USESETEUID 1 /* has usable seteuid(2) call */ 2342 # endif /* _POSIX_VERSION >= 199500 && !defined(USESETEUID) */ 2343 #endif /* _POSIX_VERSION */ 2344 /* 2345 ** Tweaking for systems that (for example) claim to be BSD or POSIX 2346 ** but don't have all the standard BSD or POSIX routines (boo hiss). 2347 */ 2348 2349 #ifdef titan 2350 # undef HASINITGROUPS /* doesn't have initgroups(3) call */ 2351 #endif /* titan */ 2352 2353 #ifdef _CRAYCOM 2354 # undef HASSETSID /* despite POSIX claim, doesn't have setsid */ 2355 #endif /* _CRAYCOM */ 2356 2357 #ifdef MOTO 2358 # undef USESETEUID 2359 #endif /* MOTO */ 2360 2361 /* 2362 ** Due to a "feature" in some operating systems such as Ultrix 4.3 and 2363 ** HPUX 8.0, if you receive a "No route to host" message (ICMP message 2364 ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host 2365 ** are closed. Some firewalls return this error if you try to connect 2366 ** to the IDENT port (113), so you can't receive email from these hosts 2367 ** on these systems. The firewall really should use a more specific 2368 ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _FILTER_PROHIB. If 2369 ** not explicitly set to zero above, default it on. 2370 */ 2371 2372 #ifndef IDENTPROTO 2373 # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ 2374 #endif /* ! IDENTPROTO */ 2375 2376 #ifndef IP_SRCROUTE 2377 # define IP_SRCROUTE 1 /* Detect IP source routing */ 2378 #endif /* ! IP_SRCROUTE */ 2379 2380 #ifndef HASGETUSERSHELL 2381 # define HASGETUSERSHELL 1 /* libc has getusershell(3) call */ 2382 #endif /* ! HASGETUSERSHELL */ 2383 2384 #ifndef NETUNIX 2385 # define NETUNIX 1 /* include unix domain support */ 2386 #endif /* ! NETUNIX */ 2387 2388 #ifndef HASRANDOM 2389 # define HASRANDOM 1 /* has random(3) support */ 2390 #endif /* ! HASRANDOM */ 2391 2392 #ifndef HASFLOCK 2393 # define HASFLOCK 0 /* assume no flock(2) support */ 2394 #endif /* ! HASFLOCK */ 2395 2396 #ifndef HASSETREUID 2397 # define HASSETREUID 0 /* assume no setreuid(2) call */ 2398 #endif /* ! HASSETREUID */ 2399 2400 #ifndef HASFCHMOD 2401 # define HASFCHMOD 0 /* assume no fchmod(2) syscall */ 2402 #endif /* ! HASFCHMOD */ 2403 2404 #ifndef USESETEUID 2405 # define USESETEUID 0 /* assume no seteuid(2) call or no saved ids */ 2406 #endif /* ! USESETEUID */ 2407 2408 #ifndef HASSETRLIMIT 2409 # define HASSETRLIMIT 0 /* assume no setrlimit(2) support */ 2410 #endif /* ! HASSETRLIMIT */ 2411 2412 #ifndef HASULIMIT 2413 # define HASULIMIT 0 /* assume no ulimit(2) support */ 2414 #endif /* ! HASULIMIT */ 2415 2416 #ifndef SECUREWARE 2417 # define SECUREWARE 0 /* assume no SecureWare C2 auditing hooks */ 2418 #endif /* ! SECUREWARE */ 2419 2420 #ifndef USE_SIGLONGJMP 2421 # define USE_SIGLONGJMP 0 /* assume setjmp handles signals properly */ 2422 #endif /* ! USE_SIGLONGJMP */ 2423 2424 #ifndef FDSET_CAST 2425 # define FDSET_CAST /* (empty) cast for fd_set arg to select */ 2426 #endif /* ! FDSET_CAST */ 2427 2428 /* 2429 ** Pick a mailer setuid method for changing the current uid 2430 */ 2431 2432 #define USE_SETEUID 0 2433 #define USE_SETREUID 1 2434 #define USE_SETUID 2 2435 2436 #if USESETEUID 2437 # define MAILER_SETUID_METHOD USE_SETEUID 2438 #else /* USESETEUID */ 2439 # if HASSETREUID 2440 # define MAILER_SETUID_METHOD USE_SETREUID 2441 # else /* HASSETREUID */ 2442 # define MAILER_SETUID_METHOD USE_SETUID 2443 # endif /* HASSETREUID */ 2444 #endif /* USESETEUID */ 2445 2446 /* 2447 ** If no type for argument two of getgroups call is defined, assume 2448 ** it's an integer -- unfortunately, there seem to be several choices 2449 ** here. 2450 */ 2451 2452 #ifndef GIDSET_T 2453 # define GIDSET_T int 2454 #endif /* ! GIDSET_T */ 2455 2456 #ifndef UID_T 2457 # define UID_T uid_t 2458 #endif /* ! UID_T */ 2459 2460 #ifndef GID_T 2461 # define GID_T gid_t 2462 #endif /* ! GID_T */ 2463 2464 #ifndef SIZE_T 2465 # define SIZE_T size_t 2466 #endif /* ! SIZE_T */ 2467 2468 #ifndef MODE_T 2469 # define MODE_T mode_t 2470 #endif /* ! MODE_T */ 2471 2472 #ifndef ARGV_T 2473 # define ARGV_T char ** 2474 #endif /* ! ARGV_T */ 2475 2476 #ifndef SOCKADDR_LEN_T 2477 # define SOCKADDR_LEN_T int 2478 #endif /* ! SOCKADDR_LEN_T */ 2479 2480 #ifndef SOCKOPT_LEN_T 2481 # define SOCKOPT_LEN_T int 2482 #endif /* ! SOCKOPT_LEN_T */ 2483 2484 #ifndef QUAD_T 2485 # define QUAD_T unsigned long 2486 #endif /* ! QUAD_T */ 2487 /********************************************************************** 2488 ** Remaining definitions should never have to be changed. They are 2489 ** primarily to provide back compatibility for older systems -- for 2490 ** example, it includes some POSIX compatibility definitions 2491 **********************************************************************/ 2492 2493 /* System 5 compatibility */ 2494 #ifndef S_ISREG 2495 # define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG) 2496 #endif /* ! S_ISREG */ 2497 #ifndef S_ISDIR 2498 # define S_ISDIR(foo) ((foo & S_IFMT) == S_IFDIR) 2499 #endif /* ! S_ISDIR */ 2500 #if !defined(S_ISLNK) && defined(S_IFLNK) 2501 # define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK) 2502 #endif /* !defined(S_ISLNK) && defined(S_IFLNK) */ 2503 #if !defined(S_ISFIFO) 2504 # if defined(S_IFIFO) 2505 # define S_ISFIFO(foo) ((foo & S_IFMT) == S_IFIFO) 2506 # else /* defined(S_IFIFO) */ 2507 # define S_ISFIFO(foo) FALSE 2508 # endif /* defined(S_IFIFO) */ 2509 #endif /* !defined(S_ISFIFO) */ 2510 #ifndef S_IRUSR 2511 # define S_IRUSR 0400 2512 #endif /* ! S_IRUSR */ 2513 #ifndef S_IWUSR 2514 # define S_IWUSR 0200 2515 #endif /* ! S_IWUSR */ 2516 #ifndef S_IRGRP 2517 # define S_IRGRP 0040 2518 #endif /* ! S_IRGRP */ 2519 #ifndef S_IWGRP 2520 # define S_IWGRP 0020 2521 #endif /* ! S_IWGRP */ 2522 #ifndef S_IROTH 2523 # define S_IROTH 0004 2524 #endif /* ! S_IROTH */ 2525 #ifndef S_IWOTH 2526 # define S_IWOTH 0002 2527 #endif /* ! S_IWOTH */ 2528 2529 #ifndef O_ACCMODE 2530 # define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) 2531 #endif /* ! O_ACCMODE */ 2532 2533 /* close-on-exec flag */ 2534 #ifndef FD_CLOEXEC 2535 # define FD_CLOEXEC 1 2536 #endif /* ! FD_CLOEXEC */ 2537 2538 /* 2539 ** Older systems don't have this error code -- it should be in 2540 ** /usr/include/sysexits.h. 2541 */ 2542 2543 #ifndef EX_CONFIG 2544 # define EX_CONFIG 78 /* configuration error */ 2545 #endif /* ! EX_CONFIG */ 2546 2547 /* pseudo-codes */ 2548 #define EX_QUIT 22 /* drop out of server immediately */ 2549 #define EX_RESTART 23 /* restart sendmail daemon */ 2550 #define EX_SHUTDOWN 24 /* shutdown sendmail daemon */ 2551 2552 /* pseudo-code used for mci_setstat */ 2553 #define EX_NOTSTICKY -5 /* don't save persistent status */ 2554 2555 2556 /* 2557 ** An "impossible" file mode to indicate that the file does not exist. 2558 */ 2559 2560 #define ST_MODE_NOFILE 0171147 /* unlikely to occur */ 2561 2562 2563 /* type of arbitrary pointer */ 2564 #ifndef ARBPTR_T 2565 # define ARBPTR_T void * 2566 #endif /* ! ARBPTR_T */ 2567 2568 #ifndef __P 2569 # include "sendmail/cdefs.h" 2570 #endif /* ! __P */ 2571 2572 #if HESIOD && !defined(NAMED_BIND) 2573 # define NAMED_BIND 1 /* not one without the other */ 2574 #endif /* HESIOD && !defined(NAMED_BIND) */ 2575 2576 # if NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno ) 2577 extern int h_errno; 2578 # endif /* NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno ) */ 2579 2580 #ifdef LDAPMAP 2581 # include <sys/time.h> 2582 # include <lber.h> 2583 # include <ldap.h> 2584 2585 /* Some LDAP constants */ 2586 # define LDAPMAP_FALSE 0 2587 # define LDAPMAP_TRUE 1 2588 2589 /* 2590 ** ldap_init(3) is broken in Umich 3.x and OpenLDAP 1.0/1.1. 2591 ** Use the lack of LDAP_OPT_SIZELIMIT to detect old API implementations 2592 ** and assume (falsely) that all old API implementations are broken. 2593 ** (OpenLDAP 1.2 and later have a working ldap_init(), add -DUSE_LDAP_INIT) 2594 */ 2595 2596 # if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT) 2597 # define USE_LDAP_INIT 1 2598 # endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT) */ 2599 2600 /* 2601 ** LDAP_OPT_SIZELIMIT is not defined under Umich 3.x nor OpenLDAP 1.x, 2602 ** hence ldap_set_option() must not exist. 2603 */ 2604 2605 # if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION) 2606 # define USE_LDAP_SET_OPTION 1 2607 # endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION) */ 2608 2609 #endif /* LDAPMAP */ 2610 2611 /* 2612 ** Do some required dependencies 2613 */ 2614 2615 #if NETINET || NETINET6 || NETISO 2616 # ifndef SMTP 2617 # define SMTP 1 /* enable user and server SMTP */ 2618 # endif /* ! SMTP */ 2619 # ifndef QUEUE 2620 # define QUEUE 1 /* enable queueing */ 2621 # endif /* ! QUEUE */ 2622 # ifndef DAEMON 2623 # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ 2624 # endif /* ! DAEMON */ 2625 #endif /* NETINET || NETINET6 || NETISO */ 2626 2627 2628 /* 2629 ** Arrange to use either varargs or stdargs 2630 */ 2631 2632 #ifdef __STDC__ 2633 2634 # include <stdarg.h> 2635 2636 # define VA_LOCAL_DECL va_list ap; 2637 # define VA_START(f) va_start(ap, f) 2638 # define VA_END va_end(ap) 2639 2640 #else /* __STDC__ */ 2641 2642 # include <varargs.h> 2643 2644 # define VA_LOCAL_DECL va_list ap; 2645 # define VA_START(f) va_start(ap) 2646 # define VA_END va_end(ap) 2647 2648 #endif /* __STDC__ */ 2649 2650 #if HASUNAME 2651 # include <sys/utsname.h> 2652 # ifdef newstr 2653 # undef newstr 2654 # endif /* newstr */ 2655 #else /* HASUNAME */ 2656 # define NODE_LENGTH 32 2657 struct utsname 2658 { 2659 char nodename[NODE_LENGTH + 1]; 2660 }; 2661 #endif /* HASUNAME */ 2662 2663 #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V) 2664 # define MAXHOSTNAMELEN 256 2665 #endif /* !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V) */ 2666 2667 #if !defined(SIGCHLD) && defined(SIGCLD) 2668 # define SIGCHLD SIGCLD 2669 #endif /* !defined(SIGCHLD) && defined(SIGCLD) */ 2670 2671 #ifndef STDIN_FILENO 2672 # define STDIN_FILENO 0 2673 #endif /* ! STDIN_FILENO */ 2674 2675 #ifndef STDOUT_FILENO 2676 # define STDOUT_FILENO 1 2677 #endif /* ! STDOUT_FILENO */ 2678 2679 #ifndef STDERR_FILENO 2680 # define STDERR_FILENO 2 2681 #endif /* ! STDERR_FILENO */ 2682 2683 #ifndef LOCK_SH 2684 # define LOCK_SH 0x01 /* shared lock */ 2685 # define LOCK_EX 0x02 /* exclusive lock */ 2686 # define LOCK_NB 0x04 /* non-blocking lock */ 2687 # define LOCK_UN 0x08 /* unlock */ 2688 #endif /* ! LOCK_SH */ 2689 2690 #ifndef S_IXOTH 2691 # define S_IXOTH (S_IEXEC >> 6) 2692 #endif /* ! S_IXOTH */ 2693 2694 #ifndef S_IXGRP 2695 # define S_IXGRP (S_IEXEC >> 3) 2696 #endif /* ! S_IXGRP */ 2697 2698 #ifndef S_IXUSR 2699 # define S_IXUSR (S_IEXEC) 2700 #endif /* ! S_IXUSR */ 2701 2702 #ifndef SEEK_SET 2703 # define SEEK_SET 0 2704 # define SEEK_CUR 1 2705 # define SEEK_END 2 2706 #endif /* ! SEEK_SET */ 2707 2708 #ifndef SIG_ERR 2709 # define SIG_ERR ((void (*)()) -1) 2710 #endif /* ! SIG_ERR */ 2711 2712 #ifndef WEXITSTATUS 2713 # define WEXITSTATUS(st) (((st) >> 8) & 0377) 2714 #endif /* ! WEXITSTATUS */ 2715 #ifndef WIFEXITED 2716 # define WIFEXITED(st) (((st) & 0377) == 0) 2717 #endif /* ! WIFEXITED */ 2718 #ifndef WIFSTOPPED 2719 # define WIFSTOPPED(st) (((st) & 0100) == 0) 2720 #endif /* ! WIFSTOPPED */ 2721 #ifndef WCOREDUMP 2722 # define WCOREDUMP(st) (((st) & 0200) != 0) 2723 #endif /* ! WCOREDUMP */ 2724 #ifndef WTERMSIG 2725 # define WTERMSIG(st) (((st) & 0177)) 2726 #endif /* ! WTERMSIG */ 2727 2728 #ifndef SIGFUNC_DEFINED 2729 typedef void (*sigfunc_t) __P((int)); 2730 #endif /* ! SIGFUNC_DEFINED */ 2731 #ifndef SIGFUNC_RETURN 2732 # define SIGFUNC_RETURN 2733 #endif /* ! SIGFUNC_RETURN */ 2734 #ifndef SIGFUNC_DECL 2735 # define SIGFUNC_DECL void 2736 #endif /* ! SIGFUNC_DECL */ 2737 2738 /* size of syslog buffer */ 2739 #ifndef SYSLOG_BUFSIZE 2740 # define SYSLOG_BUFSIZE 1024 2741 #endif /* ! SYSLOG_BUFSIZE */ 2742 2743 /* 2744 ** Size of prescan buffer. 2745 ** Despite comments in the _sendmail_ book, this probably should 2746 ** not be changed; there are some hard-to-define dependencies. 2747 */ 2748 2749 #define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ 2750 2751 /* fork routine -- set above using #ifdef _osname_ or in Makefile */ 2752 #ifndef FORK 2753 # define FORK fork /* function to call to fork mailer */ 2754 #endif /* ! FORK */ 2755 2756 /* setting h_errno */ 2757 #ifndef SM_SET_H_ERRNO 2758 # define SM_SET_H_ERRNO(err) h_errno = (err) 2759 #endif /* SM_SET_H_ERRNO */ 2760 2761 /* random routine -- set above using #ifdef _osname_ or in Makefile */ 2762 #if HASRANDOM 2763 # define get_random() random() 2764 #else /* HASRANDOM */ 2765 # define get_random() ((long) rand()) 2766 # ifndef RANDOMSHIFT 2767 # define RANDOMSHIFT 8 2768 # endif /* RANDOMSHIFT */ 2769 #endif /* HASRANDOM */ 2770 2771 /* 2772 ** Default to using scanf in readcf. 2773 */ 2774 2775 #ifndef SCANF 2776 # define SCANF 1 2777 #endif /* ! SCANF */ 2778 2779 #if _FFR_MILTER 2780 /* 32 bit type */ 2781 # ifndef SM_INT32 2782 # define SM_INT32 int32_t 2783 # endif /* SM_INT32 */ 2784 #endif /* _FFR_MILTER */ 2785 2786 /* 2787 ** SVr4 and similar systems use different routines for setjmp/longjmp 2788 ** with signal support 2789 */ 2790 2791 #if USE_SIGLONGJMP 2792 # ifdef jmp_buf 2793 # undef jmp_buf 2794 # endif /* jmp_buf */ 2795 # define jmp_buf sigjmp_buf 2796 # ifdef setjmp 2797 # undef setjmp 2798 # endif /* setjmp */ 2799 # define setjmp(env) sigsetjmp(env, 1) 2800 # ifdef longjmp 2801 # undef longjmp 2802 # endif /* longjmp */ 2803 # define longjmp(env, val) siglongjmp(env, val) 2804 #endif /* USE_SIGLONGJMP */ 2805 2806 #if !defined(NGROUPS_MAX) && defined(NGROUPS) 2807 # define NGROUPS_MAX NGROUPS /* POSIX naming convention */ 2808 #endif /* !defined(NGROUPS_MAX) && defined(NGROUPS) */ 2809 2810 /* 2811 ** Some snprintf() implementations are rumored not to NUL terminate. 2812 */ 2813 #if SNPRINTF_IS_BROKEN 2814 # ifdef snprintf 2815 # undef snprintf 2816 # endif /* snprintf */ 2817 # define snprintf sm_snprintf 2818 # ifdef vsnprintf 2819 # undef vsnprintf 2820 # endif /* vsnprintf */ 2821 # define vsnprintf sm_vsnprintf 2822 #endif /* SNPRINTF_IS_BROKEN */ 2823 2824 /* 2825 ** If we don't have a system syslog, simulate it. 2826 */ 2827 2828 #if !LOG 2829 # define LOG_EMERG 0 /* system is unusable */ 2830 # define LOG_ALERT 1 /* action must be taken immediately */ 2831 # define LOG_CRIT 2 /* critical conditions */ 2832 # define LOG_ERR 3 /* error conditions */ 2833 # define LOG_WARNING 4 /* warning conditions */ 2834 # define LOG_NOTICE 5 /* normal but significant condition */ 2835 # define LOG_INFO 6 /* informational */ 2836 # define LOG_DEBUG 7 /* debug-level messages */ 2837 #endif /* !LOG */ 2838 2839 #if SFIO 2840 # ifdef ERRLIST_PREDEFINED 2841 # undef ERRLIST_PREDEFINED 2842 # endif /* ERRLIST_PREDEFINED */ 2843 # if !HASSNPRINTF 2844 # define HASSNPRINTF 1 /* sfio includes snprintf() */ 2845 # endif /* !HASSNPRINTF */ 2846 #endif /* SFIO */ 2847 2848 #ifndef SFIO_STDIO_COMPAT 2849 # define SFIO_STDIO_COMPAT 0 2850 #endif /* ! SFIO_STDIO_COMPAT */ 2851 2852 #endif /* CONF_H */ 2853