Deleted Added
full compact
conf.c (141862) conf.c (147081)
1/*
1/*
2 * Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers.
2 * Copyright (c) 1998-2005 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 *
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 * $FreeBSD: head/contrib/sendmail/src/conf.c 141862 2005-02-14 02:39:14Z gshapiro $
12 * $FreeBSD: head/contrib/sendmail/src/conf.c 147081 2005-06-07 04:17:21Z gshapiro $
13 */
14
15#include <sendmail.h>
16
13 */
14
15#include <sendmail.h>
16
17SM_RCSID("@(#)$Id: conf.c,v 8.1052 2004/12/15 22:45:55 ca Exp $")
17SM_RCSID("@(#)$Id: conf.c,v 8.1061 2005/03/07 17:18:44 ca Exp $")
18
19#include <sendmail/pathnames.h>
20#if NEWDB
21# include "sm/bdb.h"
22#endif /* NEWDB */
23
24# include <sys/ioctl.h>
25# include <sys/param.h>

--- 1401 unchanged lines hidden (view full) ---

1427#define LA_READKSYM 8 /* SVR4: use MIOC_READKSYM ioctl call */
1428#define LA_DGUX 9 /* special DGUX implementation */
1429#define LA_HPUX 10 /* special HPUX implementation */
1430#define LA_IRIX6 11 /* special IRIX 6.2 implementation */
1431#define LA_KSTAT 12 /* special Solaris kstat(3k) implementation */
1432#define LA_DEVSHORT 13 /* read short from a device */
1433#define LA_ALPHAOSF 14 /* Digital UNIX (OSF/1 on Alpha) table() call */
1434#define LA_PSET 15 /* Solaris per-processor-set load average */
18
19#include <sendmail/pathnames.h>
20#if NEWDB
21# include "sm/bdb.h"
22#endif /* NEWDB */
23
24# include <sys/ioctl.h>
25# include <sys/param.h>

--- 1401 unchanged lines hidden (view full) ---

1427#define LA_READKSYM 8 /* SVR4: use MIOC_READKSYM ioctl call */
1428#define LA_DGUX 9 /* special DGUX implementation */
1429#define LA_HPUX 10 /* special HPUX implementation */
1430#define LA_IRIX6 11 /* special IRIX 6.2 implementation */
1431#define LA_KSTAT 12 /* special Solaris kstat(3k) implementation */
1432#define LA_DEVSHORT 13 /* read short from a device */
1433#define LA_ALPHAOSF 14 /* Digital UNIX (OSF/1 on Alpha) table() call */
1434#define LA_PSET 15 /* Solaris per-processor-set load average */
1435#define LA_LONGLONG 17 /* read kmem for avenrun; interpret as long long */
1435
1436/* do guesses based on general OS type */
1437#ifndef LA_TYPE
1438# define LA_TYPE LA_ZERO
1439#endif /* ! LA_TYPE */
1440
1441#ifndef FSHIFT
1442# if defined(unixpc)

--- 22 unchanged lines hidden (view full) ---

1465# endif /* SYSTEM5 */
1466#endif /* ! LA_AVENRUN */
1467
1468/* _PATH_KMEM should be defined in <paths.h> */
1469#ifndef _PATH_KMEM
1470# define _PATH_KMEM "/dev/kmem"
1471#endif /* ! _PATH_KMEM */
1472
1436
1437/* do guesses based on general OS type */
1438#ifndef LA_TYPE
1439# define LA_TYPE LA_ZERO
1440#endif /* ! LA_TYPE */
1441
1442#ifndef FSHIFT
1443# if defined(unixpc)

--- 22 unchanged lines hidden (view full) ---

1466# endif /* SYSTEM5 */
1467#endif /* ! LA_AVENRUN */
1468
1469/* _PATH_KMEM should be defined in <paths.h> */
1470#ifndef _PATH_KMEM
1471# define _PATH_KMEM "/dev/kmem"
1472#endif /* ! _PATH_KMEM */
1473
1473#if (LA_TYPE == LA_INT) || (LA_TYPE == LA_FLOAT) || (LA_TYPE == LA_SHORT)
1474#if (LA_TYPE == LA_INT) || (LA_TYPE == LA_FLOAT) || (LA_TYPE == LA_SHORT) || (LA_TYPE == LA_LONGLONG)
1474
1475# include <nlist.h>
1476
1477/* _PATH_UNIX should be defined in <paths.h> */
1478# ifndef _PATH_UNIX
1479# if defined(SYSTEM5)
1480# define _PATH_UNIX "/unix"
1481# else /* defined(SYSTEM5) */

--- 17 unchanged lines hidden (view full) ---

1499{
1500 int j;
1501 static int kmem = -1;
1502# if LA_TYPE == LA_INT
1503 long avenrun[3];
1504# else /* LA_TYPE == LA_INT */
1505# if LA_TYPE == LA_SHORT
1506 short avenrun[3];
1475
1476# include <nlist.h>
1477
1478/* _PATH_UNIX should be defined in <paths.h> */
1479# ifndef _PATH_UNIX
1480# if defined(SYSTEM5)
1481# define _PATH_UNIX "/unix"
1482# else /* defined(SYSTEM5) */

--- 17 unchanged lines hidden (view full) ---

1500{
1501 int j;
1502 static int kmem = -1;
1503# if LA_TYPE == LA_INT
1504 long avenrun[3];
1505# else /* LA_TYPE == LA_INT */
1506# if LA_TYPE == LA_SHORT
1507 short avenrun[3];
1507# else /* LA_TYPE == LA_SHORT */
1508# else
1509# if LA_TYPE == LA_LONGLONG
1510 long long avenrun[3];
1511# else /* LA_TYPE == LA_LONGLONG */
1508 double avenrun[3];
1512 double avenrun[3];
1513# endif /* LA_TYPE == LA_LONGLONG */
1509# endif /* LA_TYPE == LA_SHORT */
1510# endif /* LA_TYPE == LA_INT */
1511 extern off_t lseek();
1512
1513 if (kmem < 0)
1514 {
1515# ifdef _AUX_SOURCE
1516 (void) sm_strlcpy(Nl[X_AVENRUN].n_name, LA_AVENRUN,

--- 49 unchanged lines hidden (view full) ---

1566 read(kmem, (char *) avenrun, sizeof(avenrun)) < sizeof(avenrun))
1567 {
1568 /* thank you Ian */
1569 if (tTd(3, 1))
1570 sm_dprintf("getla: lseek or read: %s\n",
1571 sm_errstring(errno));
1572 return -1;
1573 }
1514# endif /* LA_TYPE == LA_SHORT */
1515# endif /* LA_TYPE == LA_INT */
1516 extern off_t lseek();
1517
1518 if (kmem < 0)
1519 {
1520# ifdef _AUX_SOURCE
1521 (void) sm_strlcpy(Nl[X_AVENRUN].n_name, LA_AVENRUN,

--- 49 unchanged lines hidden (view full) ---

1571 read(kmem, (char *) avenrun, sizeof(avenrun)) < sizeof(avenrun))
1572 {
1573 /* thank you Ian */
1574 if (tTd(3, 1))
1575 sm_dprintf("getla: lseek or read: %s\n",
1576 sm_errstring(errno));
1577 return -1;
1578 }
1574# if (LA_TYPE == LA_INT) || (LA_TYPE == LA_SHORT)
1579# if (LA_TYPE == LA_INT) || (LA_TYPE == LA_SHORT) || (LA_TYPE == LA_LONGLONG)
1575 if (tTd(3, 5))
1576 {
1577# if LA_TYPE == LA_SHORT
1578 sm_dprintf("getla: avenrun = %d", avenrun[0]);
1579 if (tTd(3, 15))
1580 sm_dprintf(", %d, %d", avenrun[1], avenrun[2]);
1581# else /* LA_TYPE == LA_SHORT */
1580 if (tTd(3, 5))
1581 {
1582# if LA_TYPE == LA_SHORT
1583 sm_dprintf("getla: avenrun = %d", avenrun[0]);
1584 if (tTd(3, 15))
1585 sm_dprintf(", %d, %d", avenrun[1], avenrun[2]);
1586# else /* LA_TYPE == LA_SHORT */
1587# if LA_TYPE == LA_LONGLONG
1588 sm_dprintf("getla: avenrun = %lld", avenrun[0]);
1589 if (tTd(3, 15))
1590 sm_dprintf(", %lld, %lld", avenrun[1], avenrun[2]);
1591# else /* LA_TYPE == LA_LONGLONG */
1582 sm_dprintf("getla: avenrun = %ld", avenrun[0]);
1583 if (tTd(3, 15))
1584 sm_dprintf(", %ld, %ld", avenrun[1], avenrun[2]);
1592 sm_dprintf("getla: avenrun = %ld", avenrun[0]);
1593 if (tTd(3, 15))
1594 sm_dprintf(", %ld, %ld", avenrun[1], avenrun[2]);
1595# endif /* LA_TYPE == LA_LONGLONG */
1585# endif /* LA_TYPE == LA_SHORT */
1586 sm_dprintf("\n");
1587 }
1588 if (tTd(3, 1))
1589 sm_dprintf("getla: %d\n",
1590 (int) (avenrun[0] + FSCALE/2) >> FSHIFT);
1591 return ((int) (avenrun[0] + FSCALE/2) >> FSHIFT);
1596# endif /* LA_TYPE == LA_SHORT */
1597 sm_dprintf("\n");
1598 }
1599 if (tTd(3, 1))
1600 sm_dprintf("getla: %d\n",
1601 (int) (avenrun[0] + FSCALE/2) >> FSHIFT);
1602 return ((int) (avenrun[0] + FSCALE/2) >> FSHIFT);
1592# else /* (LA_TYPE == LA_INT) || (LA_TYPE == LA_SHORT) */
1603# else /* (LA_TYPE == LA_INT) || (LA_TYPE == LA_SHORT) || (LA_TYPE == LA_LONGLONG) */
1593 if (tTd(3, 5))
1594 {
1595 sm_dprintf("getla: avenrun = %g", avenrun[0]);
1596 if (tTd(3, 15))
1597 sm_dprintf(", %g, %g", avenrun[1], avenrun[2]);
1598 sm_dprintf("\n");
1599 }
1600 if (tTd(3, 1))
1601 sm_dprintf("getla: %d\n", (int) (avenrun[0] +0.5));
1602 return ((int) (avenrun[0] + 0.5));
1604 if (tTd(3, 5))
1605 {
1606 sm_dprintf("getla: avenrun = %g", avenrun[0]);
1607 if (tTd(3, 15))
1608 sm_dprintf(", %g, %g", avenrun[1], avenrun[2]);
1609 sm_dprintf("\n");
1610 }
1611 if (tTd(3, 1))
1612 sm_dprintf("getla: %d\n", (int) (avenrun[0] +0.5));
1613 return ((int) (avenrun[0] + 0.5));
1603# endif /* (LA_TYPE == LA_INT) || (LA_TYPE == LA_SHORT) */
1614# endif /* (LA_TYPE == LA_INT) || (LA_TYPE == LA_SHORT) || (LA_TYPE == LA_LONGLONG) */
1604}
1605
1615}
1616
1606#endif /* (LA_TYPE == LA_INT) || (LA_TYPE == LA_FLOAT) || (LA_TYPE == LA_SHORT) */
1617#endif /* (LA_TYPE == LA_INT) || (LA_TYPE == LA_FLOAT) || (LA_TYPE == LA_SHORT) || (LA_TYPE == LA_LONGLONG) */
1607
1608#if LA_TYPE == LA_READKSYM
1609
1610# include <sys/ksym.h>
1611
1612int
1613getla()
1614{

--- 4421 unchanged lines hidden (view full) ---

6036 /* What it says :-) */
6037 "_FFR_DEPRECATE_MAILER_FLAG_I",
6038#endif /* _FFR_DEPRECATE_MAILER_FLAG_I */
6039#if _FFR_DIGUNIX_SAFECHOWN
6040 /* Properly set SAFECHOWN (include/sm/conf.h) for Digital UNIX */
6041/* Problem noted by Anne Bennett of Concordia University */
6042 "_FFR_DIGUNIX_SAFECHOWN",
6043#endif /* _FFR_DIGUNIX_SAFECHOWN */
1618
1619#if LA_TYPE == LA_READKSYM
1620
1621# include <sys/ksym.h>
1622
1623int
1624getla()
1625{

--- 4421 unchanged lines hidden (view full) ---

6047 /* What it says :-) */
6048 "_FFR_DEPRECATE_MAILER_FLAG_I",
6049#endif /* _FFR_DEPRECATE_MAILER_FLAG_I */
6050#if _FFR_DIGUNIX_SAFECHOWN
6051 /* Properly set SAFECHOWN (include/sm/conf.h) for Digital UNIX */
6052/* Problem noted by Anne Bennett of Concordia University */
6053 "_FFR_DIGUNIX_SAFECHOWN",
6054#endif /* _FFR_DIGUNIX_SAFECHOWN */
6055#if _FFR_DM_PER_DAEMON
6056 /* DeliveryMode per DaemonPortOptions: 'D' */
6057 "_FFR_DM_PER_DAEMON",
6058#endif /* _FFR_DM_PER_DAEMON */
6044#if _FFR_DNSMAP_ALIASABLE
6045 /* Allow dns map type to be used for aliases. */
6046/* Don Lewis of TDK */
6047 "_FFR_DNSMAP_ALIASABLE",
6048#endif /* _FFR_DNSMAP_ALIASABLE */
6049#if _FFR_DNSMAP_BASE
6050 /* Specify a "base" domain for DNS lookups. */
6051 "_FFR_DNSMAP_BASE",

--- 114 unchanged lines hidden (view full) ---

6166 /* Do not issue a DELAY DSN for mailers that use the hold flag. */
6167/* Steven Pitzl */
6168 "_FFR_NODELAYDSN_ON_HOLD",
6169#endif /* _FFR_NODELAYDSN_ON_HOLD */
6170#if _FFR_NO_PIPE
6171 /* Disable PIPELINING, delay client if used. */
6172 "_FFR_NO_PIPE",
6173#endif /* _FFR_NO_PIPE */
6059#if _FFR_DNSMAP_ALIASABLE
6060 /* Allow dns map type to be used for aliases. */
6061/* Don Lewis of TDK */
6062 "_FFR_DNSMAP_ALIASABLE",
6063#endif /* _FFR_DNSMAP_ALIASABLE */
6064#if _FFR_DNSMAP_BASE
6065 /* Specify a "base" domain for DNS lookups. */
6066 "_FFR_DNSMAP_BASE",

--- 114 unchanged lines hidden (view full) ---

6181 /* Do not issue a DELAY DSN for mailers that use the hold flag. */
6182/* Steven Pitzl */
6183 "_FFR_NODELAYDSN_ON_HOLD",
6184#endif /* _FFR_NODELAYDSN_ON_HOLD */
6185#if _FFR_NO_PIPE
6186 /* Disable PIPELINING, delay client if used. */
6187 "_FFR_NO_PIPE",
6188#endif /* _FFR_NO_PIPE */
6189#if _FFR_LOG_NTRIES
6190 /* log ntries=, from Nik Clayton of FreeBSD */
6191 "_FFR_LOG_NTRIES",
6192#endif /* _FFR_LOG_NTRIES */
6174#if _FFR_PRIV_NOACTUALRECIPIENT
6175 /*
6176 ** PrivacyOptions=noactualrecipient stops sendmail from putting
6177 ** X-Actual-Recipient lines in DSNs revealing the actual
6178 ** account that addresses map to. Patch from Dan Harkless.
6179 */
6180
6193#if _FFR_PRIV_NOACTUALRECIPIENT
6194 /*
6195 ** PrivacyOptions=noactualrecipient stops sendmail from putting
6196 ** X-Actual-Recipient lines in DSNs revealing the actual
6197 ** account that addresses map to. Patch from Dan Harkless.
6198 */
6199
6181 "_FFR_PRIV_NOACTUALRECIPIENT"
6200 "_FFR_PRIV_NOACTUALRECIPIENT",
6182#endif /* _FFR_PRIV_NOACTUALRECIPIENT */
6183#if _FFR_QUEUEDELAY
6184 /* Exponential queue delay; disabled in 8.13 since it isn't used. */
6185 "_FFR_QUEUEDELAY",
6186#endif /* _FFR_QUEUEDELAY */
6187#if _FFR_QUEUE_GROUP_SORTORDER
6188 /* Allow QueueSortOrder per queue group. */
6189/* XXX: Still need to actually use qgrp->qg_sortorder */

--- 55 unchanged lines hidden (view full) ---

6245 ** of 8 bytes (including terminating NULL), initsetproctitle() won't
6246 ** use any of the space beyond argv[0]. Be sure to set SPT_ALIGN_SIZE
6247 ** if you use this FFR.
6248 */
6249
6250/* Chris Adams of HiWAAY Informations Services */
6251 "_FFR_SPT_ALIGN",
6252#endif /* _FFR_SPT_ALIGN */
6201#endif /* _FFR_PRIV_NOACTUALRECIPIENT */
6202#if _FFR_QUEUEDELAY
6203 /* Exponential queue delay; disabled in 8.13 since it isn't used. */
6204 "_FFR_QUEUEDELAY",
6205#endif /* _FFR_QUEUEDELAY */
6206#if _FFR_QUEUE_GROUP_SORTORDER
6207 /* Allow QueueSortOrder per queue group. */
6208/* XXX: Still need to actually use qgrp->qg_sortorder */

--- 55 unchanged lines hidden (view full) ---

6264 ** of 8 bytes (including terminating NULL), initsetproctitle() won't
6265 ** use any of the space beyond argv[0]. Be sure to set SPT_ALIGN_SIZE
6266 ** if you use this FFR.
6267 */
6268
6269/* Chris Adams of HiWAAY Informations Services */
6270 "_FFR_SPT_ALIGN",
6271#endif /* _FFR_SPT_ALIGN */
6272#if _FFR_SS_PER_DAEMON
6273 /* SuperSafe per DaemonPortOptions: 'T' (better letter?) */
6274 "_FFR_SS_PER_DAEMON",
6275#endif /* _FFR_SS_PER_DAEMON */
6253#if _FFR_TIMERS
6254 /* Donated code (unused). */
6255 "_FFR_TIMERS",
6256#endif /* _FFR_TIMERS */
6257#if _FFR_TLS_1
6258 /* More STARTTLS options, e.g., secondary certs. */
6259 "_FFR_TLS_1",
6260#endif /* _FFR_TLS_1 */
6261#if _FFR_TRUSTED_QF
6262 /*
6263 ** If we don't own the file mark it as unsafe.
6264 ** However, allow TrustedUser to own it as well
6265 ** in case TrustedUser manipulates the queue.
6266 */
6267
6268 "_FFR_TRUSTED_QF",
6269#endif /* _FFR_TRUSTED_QF */
6276#if _FFR_TIMERS
6277 /* Donated code (unused). */
6278 "_FFR_TIMERS",
6279#endif /* _FFR_TIMERS */
6280#if _FFR_TLS_1
6281 /* More STARTTLS options, e.g., secondary certs. */
6282 "_FFR_TLS_1",
6283#endif /* _FFR_TLS_1 */
6284#if _FFR_TRUSTED_QF
6285 /*
6286 ** If we don't own the file mark it as unsafe.
6287 ** However, allow TrustedUser to own it as well
6288 ** in case TrustedUser manipulates the queue.
6289 */
6290
6291 "_FFR_TRUSTED_QF",
6292#endif /* _FFR_TRUSTED_QF */
6293#if _FFR_USE_SEM_LOCKING
6294 "_FFR_USE_SEM_LOCKING",
6295#endif /* _FFR_USE_SEM_LOCKING */
6270#if _FFR_USE_SETLOGIN
6271 /* Use setlogin() */
6272/* Peter Philipp */
6273 "_FFR_USE_SETLOGIN",
6274#endif /* _FFR_USE_SETLOGIN */
6275 NULL
6276};
6277
6296#if _FFR_USE_SETLOGIN
6297 /* Use setlogin() */
6298/* Peter Philipp */
6299 "_FFR_USE_SETLOGIN",
6300#endif /* _FFR_USE_SETLOGIN */
6301 NULL
6302};
6303