From efe7f72391b1c519719be45ec62c5de0e7303c7d Mon Sep 17 00:00:00 2001 From: Eric Allman Date: Fri, 11 Mar 1994 22:42:15 -0800 Subject: [PATCH] change NAMED_BIND to a 0/1 flag to allow Makefile override SCCS-vsn: usr.sbin/sendmail/src/udb.c 8.6 SCCS-vsn: usr.sbin/sendmail/src/savemail.c 8.28 SCCS-vsn: usr.sbin/sendmail/src/readcf.c 8.22 SCCS-vsn: usr.sbin/sendmail/src/main.c 8.52 SCCS-vsn: usr.sbin/sendmail/src/err.c 8.26 SCCS-vsn: usr.sbin/sendmail/src/domain.c 8.19 SCCS-vsn: usr.sbin/sendmail/src/deliver.c 8.78 SCCS-vsn: usr.sbin/sendmail/src/daemon.c 8.38 SCCS-vsn: usr.sbin/sendmail/src/conf.h 8.96 --- usr/src/usr.sbin/sendmail/src/conf.h | 14 ++++++++++--- usr/src/usr.sbin/sendmail/src/daemon.c | 24 +++++++++++----------- usr/src/usr.sbin/sendmail/src/deliver.c | 26 ++++++++++++------------ usr/src/usr.sbin/sendmail/src/domain.c | 8 ++++---- usr/src/usr.sbin/sendmail/src/err.c | 6 +++--- usr/src/usr.sbin/sendmail/src/main.c | 6 +++--- usr/src/usr.sbin/sendmail/src/readcf.c | 10 ++++----- usr/src/usr.sbin/sendmail/src/savemail.c | 4 ++-- usr/src/usr.sbin/sendmail/src/udb.c | 6 +++--- 9 files changed, 56 insertions(+), 48 deletions(-) diff --git a/usr/src/usr.sbin/sendmail/src/conf.h b/usr/src/usr.sbin/sendmail/src/conf.h index 81e6dc8c3d..a23fbd6c5c 100644 --- a/usr/src/usr.sbin/sendmail/src/conf.h +++ b/usr/src/usr.sbin/sendmail/src/conf.h @@ -5,7 +5,7 @@ * * %sccs.include.redist.c% * - * @(#)conf.h 8.95 (Berkeley) %G% + * @(#)conf.h 8.96 (Berkeley) %G% */ /* @@ -54,14 +54,22 @@ # define NETUNIX 1 /* include unix domain support */ # define NETINET 1 /* include internet support */ # define SETPROCTITLE 1 /* munge argv to display current status */ -# define NAMED_BIND 1 /* use Berkeley Internet Domain Server */ # define MATCHGECOS 1 /* match user names from gecos field */ # define XDEBUG 1 /* enable extended debugging */ - # ifdef NEWDB # define USERDB 1 /* look in user database (requires NEWDB) */ # endif +/********************************************************************** +** 0/1 Compilation options. +** #define these to 1 if they are available; +** #define them to 0 otherwise. +**********************************************************************/ + +# ifndef NAMED_BIND +# define NAMED_BIND 1 /* use Berkeley Internet Domain Server */ +# endif + /* ** Most systems have symbolic links today, so default them on. You ** can turn them off by #undef'ing this below. diff --git a/usr/src/usr.sbin/sendmail/src/daemon.c b/usr/src/usr.sbin/sendmail/src/daemon.c index 6f53a67fb8..6d62b1bb89 100644 --- a/usr/src/usr.sbin/sendmail/src/daemon.c +++ b/usr/src/usr.sbin/sendmail/src/daemon.c @@ -12,9 +12,9 @@ #ifndef lint #ifdef DAEMON -static char sccsid[] = "@(#)daemon.c 8.37 (Berkeley) %G% (with daemon mode)"; +static char sccsid[] = "@(#)daemon.c 8.38 (Berkeley) %G% (with daemon mode)"; #else -static char sccsid[] = "@(#)daemon.c 8.37 (Berkeley) %G% (without daemon mode)"; +static char sccsid[] = "@(#)daemon.c 8.38 (Berkeley) %G% (without daemon mode)"; #endif #endif /* not lint */ @@ -23,7 +23,7 @@ static char sccsid[] = "@(#)daemon.c 8.37 (Berkeley) %G% (without daemon mode)"; # include # include -#ifdef NAMED_BIND +#if NAMED_BIND # include # include #endif @@ -240,7 +240,7 @@ makeconnection(host, port, mci, usesecureport) SOCKADDR addr; int sav_errno; int addrlen; -#ifdef NAMED_BIND +#if NAMED_BIND extern int h_errno; #endif @@ -249,7 +249,7 @@ makeconnection(host, port, mci, usesecureport) ** Accept "[a.b.c.d]" syntax for host name. */ -#ifdef NAMED_BIND +#if NAMED_BIND h_errno = 0; #endif errno = 0; @@ -293,7 +293,7 @@ makeconnection(host, port, mci, usesecureport) gothostent: if (hp == NULL) { -#ifdef NAMED_BIND +#if NAMED_BIND if (errno == ETIMEDOUT || h_errno == TRY_AGAIN) return (EX_TEMPFAIL); @@ -753,7 +753,7 @@ host_map_lookup(map, name, av, statp) register STAB *s; char hbuf[MAXNAME]; extern struct hostent *gethostbyaddr(); -#ifdef NAMED_BIND +#if NAMED_BIND extern int h_errno; #endif @@ -769,7 +769,7 @@ host_map_lookup(map, name, av, statp) printf("host_map_lookup(%s) => CACHE %s\n", name, s->s_namecanon.nc_cname); errno = s->s_namecanon.nc_errno; -#ifdef NAMED_BIND +#if NAMED_BIND h_errno = s->s_namecanon.nc_herrno; #endif *statp = s->s_namecanon.nc_stat; @@ -810,7 +810,7 @@ host_map_lookup(map, name, av, statp) register struct hostent *hp; s->s_namecanon.nc_errno = errno; -#ifdef NAMED_BIND +#if NAMED_BIND s->s_namecanon.nc_herrno = h_errno; if (tTd(9, 1)) printf("FAIL (%d)\n", h_errno); @@ -875,7 +875,7 @@ host_map_lookup(map, name, av, statp) /* nope -- ask the name server */ hp = gethostbyaddr((char *)&in_addr, sizeof(struct in_addr), AF_INET); s->s_namecanon.nc_errno = errno; -#ifdef NAMED_BIND +#if NAMED_BIND s->s_namecanon.nc_herrno = h_errno; #endif s->s_namecanon.nc_flags |= NCF_VALID; /* will be soon */ @@ -971,7 +971,7 @@ hostnamebyanyaddr(sap) register struct hostent *hp; int saveretry; -#ifdef NAMED_BIND +#if NAMED_BIND /* shorten name server timeout to avoid higher level timeouts */ saveretry = _res.retry; _res.retry = 3; @@ -1008,7 +1008,7 @@ hostnamebyanyaddr(sap) break; } -#ifdef NAMED_BIND +#if NAMED_BIND _res.retry = saveretry; #endif /* NAMED_BIND */ diff --git a/usr/src/usr.sbin/sendmail/src/deliver.c b/usr/src/usr.sbin/sendmail/src/deliver.c index cb3145a071..860c11ad7e 100644 --- a/usr/src/usr.sbin/sendmail/src/deliver.c +++ b/usr/src/usr.sbin/sendmail/src/deliver.c @@ -7,13 +7,13 @@ */ #ifndef lint -static char sccsid[] = "@(#)deliver.c 8.77 (Berkeley) %G%"; +static char sccsid[] = "@(#)deliver.c 8.78 (Berkeley) %G%"; #endif /* not lint */ #include "sendmail.h" #include #include -#ifdef NAMED_BIND +#if NAMED_BIND #include #include @@ -595,7 +595,7 @@ deliver(e, firstto) if (!ForceMail && bitset(QDONTSEND|QPSEUDO, to->q_flags)) return (0); -#ifdef NAMED_BIND +#if NAMED_BIND /* unless interactive, try twice, over a minute */ if (OpMode == MD_DAEMON || OpMode == MD_SMTP) { @@ -911,7 +911,7 @@ deliver(e, firstto) bitset(QGOODUID, e->e_from.q_flags)) ctladdr = &e->e_from; -#ifdef NAMED_BIND +#if NAMED_BIND if (ConfigLevel < 2) _res.options &= ~(RES_DEFNAMES | RES_DNSRCH); /* XXX */ #endif @@ -1039,7 +1039,7 @@ tryhost: bitnset(M_SECURE_PORT, m->m_flags)); mci->mci_exitstat = i; mci->mci_errno = errno; -#ifdef NAMED_BIND +#if NAMED_BIND mci->mci_herrno = h_errno; #endif if (i == EX_OK) @@ -1345,7 +1345,7 @@ tryhost: /* couldn't open the mailer */ rcode = mci->mci_exitstat; errno = mci->mci_errno; -#ifdef NAMED_BIND +#if NAMED_BIND h_errno = mci->mci_herrno; #endif if (rcode == EX_OK) @@ -1438,7 +1438,7 @@ tryhost: goto give_up; } #endif /* SMTP */ -#ifdef NAMED_BIND +#if NAMED_BIND if (ConfigLevel < 2) _res.options |= RES_DEFNAMES | RES_DNSRCH; /* XXX */ #endif @@ -1668,7 +1668,7 @@ giveresponse(stat, m, mci, ctladdr, e) else if (stat == EX_TEMPFAIL) { (void) strcpy(buf, SysExMsg[i] + 1); -#ifdef NAMED_BIND +#if NAMED_BIND if (h_errno == TRY_AGAIN) statmsg = errstring(h_errno+E_DNSBASE); else @@ -1692,7 +1692,7 @@ giveresponse(stat, m, mci, ctladdr, e) } statmsg = buf; } -#ifdef NAMED_BIND +#if NAMED_BIND else if (stat == EX_NOHOST && h_errno != 0) { statmsg = errstring(h_errno + E_DNSBASE); @@ -1751,7 +1751,7 @@ giveresponse(stat, m, mci, ctladdr, e) e->e_message = newstr(&statmsg[4]); } errno = 0; -#ifdef NAMED_BIND +#if NAMED_BIND h_errno = 0; #endif } @@ -2277,7 +2277,7 @@ hostsignature(m, host, e) register STAB *s; int i; int len; -#ifdef NAMED_BIND +#if NAMED_BIND int nmx; auto int rcode; char *hp; @@ -2309,7 +2309,7 @@ hostsignature(m, host, e) ** Not already there -- create a signature. */ -#ifdef NAMED_BIND +#if NAMED_BIND if (ConfigLevel < 2) { oldoptions = _res.options; @@ -2332,7 +2332,7 @@ hostsignature(m, host, e) mci = mci_get(hp, m); mci->mci_exitstat = rcode; mci->mci_errno = errno; -#ifdef NAMED_BIND +#if NAMED_BIND mci->mci_herrno = h_errno; #endif diff --git a/usr/src/usr.sbin/sendmail/src/domain.c b/usr/src/usr.sbin/sendmail/src/domain.c index b5b1b14e11..17af5fa361 100644 --- a/usr/src/usr.sbin/sendmail/src/domain.c +++ b/usr/src/usr.sbin/sendmail/src/domain.c @@ -9,14 +9,14 @@ #include "sendmail.h" #ifndef lint -#ifdef NAMED_BIND -static char sccsid[] = "@(#)domain.c 8.18 (Berkeley) %G% (with name server)"; +#if NAMED_BIND +static char sccsid[] = "@(#)domain.c 8.19 (Berkeley) %G% (with name server)"; #else -static char sccsid[] = "@(#)domain.c 8.18 (Berkeley) %G% (without name server)"; +static char sccsid[] = "@(#)domain.c 8.19 (Berkeley) %G% (without name server)"; #endif #endif /* not lint */ -#ifdef NAMED_BIND +#if NAMED_BIND #include #include diff --git a/usr/src/usr.sbin/sendmail/src/err.c b/usr/src/usr.sbin/sendmail/src/err.c index 02f7d94d94..1f6f1dfbef 100644 --- a/usr/src/usr.sbin/sendmail/src/err.c +++ b/usr/src/usr.sbin/sendmail/src/err.c @@ -7,7 +7,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)err.c 8.25 (Berkeley) %G%"; +static char sccsid[] = "@(#)err.c 8.26 (Berkeley) %G%"; #endif /* not lint */ # include "sendmail.h" @@ -43,7 +43,7 @@ char MsgBuf[BUFSIZ*2]; /* text of most recent message */ static void fmtmsg(); -#if defined(NAMED_BIND) && !defined(NO_DATA) +#if NAMED_BIND && !defined(NO_DATA) # define NO_DATA NO_ADDRESS #endif @@ -492,7 +492,7 @@ errstring(errnum) case EOPENTIMEOUT: return "Timeout on file open"; -# ifdef NAMED_BIND +# if NAMED_BIND case HOST_NOT_FOUND + E_DNSBASE: dnsmsg = "host not found"; break; diff --git a/usr/src/usr.sbin/sendmail/src/main.c b/usr/src/usr.sbin/sendmail/src/main.c index f62aa6fa0c..7008fd2915 100644 --- a/usr/src/usr.sbin/sendmail/src/main.c +++ b/usr/src/usr.sbin/sendmail/src/main.c @@ -13,13 +13,13 @@ static char copyright[] = #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)main.c 8.51 (Berkeley) %G%"; +static char sccsid[] = "@(#)main.c 8.52 (Berkeley) %G%"; #endif /* not lint */ #define _DEFINE #include "sendmail.h" -#ifdef NAMED_BIND +#if NAMED_BIND #include #include #endif @@ -297,7 +297,7 @@ main(argc, argv, envp) OpMode = MD_DELIVER; FullName = getenv("NAME"); -#ifdef NAMED_BIND +#if NAMED_BIND if (tTd(8, 8)) _res.options |= RES_DEBUG; #endif diff --git a/usr/src/usr.sbin/sendmail/src/readcf.c b/usr/src/usr.sbin/sendmail/src/readcf.c index 7800f528e1..93ec09f37f 100644 --- a/usr/src/usr.sbin/sendmail/src/readcf.c +++ b/usr/src/usr.sbin/sendmail/src/readcf.c @@ -7,13 +7,13 @@ */ #ifndef lint -static char sccsid[] = "@(#)readcf.c 8.21 (Berkeley) %G%"; +static char sccsid[] = "@(#)readcf.c 8.22 (Berkeley) %G%"; #endif /* not lint */ # include "sendmail.h" # include # include -#ifdef NAMED_BIND +#if NAMED_BIND # include # include #endif @@ -516,7 +516,7 @@ readcf(cfname) { /* user didn't initialize: set up host map */ strcpy(buf, "host host"); -#ifdef NAMED_BIND +#if NAMED_BIND if (ConfigLevel >= 2) strcat(buf, " -a."); #endif @@ -988,7 +988,7 @@ printrules() static BITMAP StickyOpt; /* set if option is stuck */ -#ifdef NAMED_BIND +#if NAMED_BIND struct resolverflags { @@ -1179,7 +1179,7 @@ setoption(opt, val, sticky) break; case 'I': /* use internet domain name server */ -#ifdef NAMED_BIND +#if NAMED_BIND UseNameServer = TRUE; for (p = val; *p != 0; ) { diff --git a/usr/src/usr.sbin/sendmail/src/savemail.c b/usr/src/usr.sbin/sendmail/src/savemail.c index 7482d05f9c..836e8e8b2a 100644 --- a/usr/src/usr.sbin/sendmail/src/savemail.c +++ b/usr/src/usr.sbin/sendmail/src/savemail.c @@ -7,7 +7,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)savemail.c 8.27 (Berkeley) %G%"; +static char sccsid[] = "@(#)savemail.c 8.28 (Berkeley) %G%"; #endif /* not lint */ # include "sendmail.h" @@ -769,7 +769,7 @@ errbody(mci, e) pruneroute(addr) char *addr; { -#ifdef NAMED_BIND +#if NAMED_BIND char *start, *at, *comma; char c; int rcode; diff --git a/usr/src/usr.sbin/sendmail/src/udb.c b/usr/src/usr.sbin/sendmail/src/udb.c index 9df2b20cef..af024e986f 100644 --- a/usr/src/usr.sbin/sendmail/src/udb.c +++ b/usr/src/usr.sbin/sendmail/src/udb.c @@ -10,9 +10,9 @@ #ifndef lint #ifdef USERDB -static char sccsid [] = "@(#)udb.c 8.5 (Berkeley) %G% (with USERDB)"; +static char sccsid [] = "@(#)udb.c 8.6 (Berkeley) %G% (with USERDB)"; #else -static char sccsid [] = "@(#)udb.c 8.5 (Berkeley) %G% (without USERDB)"; +static char sccsid [] = "@(#)udb.c 8.6 (Berkeley) %G% (without USERDB)"; #endif #endif @@ -544,7 +544,7 @@ _udbx_init() case '*': /* search remote database (expand MX) */ if (*spec == '*') { -#ifdef NAMED_BIND +#if NAMED_BIND nmx = getmxrr(spec + 1, mxhosts, FALSE, &rcode); #else mxhosts[0] = spec + 1; -- 2.20.1