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