head 1.1; access; symbols pkgsrc-2026Q1:1.1.0.18 pkgsrc-2026Q1-base:1.1 pkgsrc-2025Q4:1.1.0.16 pkgsrc-2025Q4-base:1.1 pkgsrc-2025Q3:1.1.0.14 pkgsrc-2025Q3-base:1.1 pkgsrc-2025Q2:1.1.0.12 pkgsrc-2025Q2-base:1.1 pkgsrc-2025Q1:1.1.0.10 pkgsrc-2025Q1-base:1.1 pkgsrc-2024Q4:1.1.0.8 pkgsrc-2024Q4-base:1.1 pkgsrc-2024Q3:1.1.0.6 pkgsrc-2024Q3-base:1.1 pkgsrc-2024Q2:1.1.0.4 pkgsrc-2024Q2-base:1.1 pkgsrc-2024Q1:1.1.0.2 pkgsrc-2024Q1-base:1.1; locks; strict; comment @# @; 1.1 date 2024.01.15.04.50.56; author jnemeth; state Exp; branches; next ; commitid Nv1wagQpcgwUbvUE; desc @@ 1.1 log @mail/sendmail-snapshot: import sendmail-8.18.0.2 Sendmail acts as a unified "post office" to which all mail can be submitted. Address interpretation is controlled by a production system, which can parse both domain-based addressing and old-style "ad hoc" addresses. The production system is powerful enough to rewrite addresses in the message header to conform to the standards of a number of common target networks, including old (NCP/RFC733) Arpanet, new (TCP/RFC822) Arpanet, UUCP, and Phonenet. Sendmail also implements an SMTP server, message queueing, and aliasing. This package is for snapshot (alpha/beta) releases, which aren't considered to be release/production quality. It may be used to test new features. Some features / bug fixes may be backported to the regular sendmail package. @ text @$NetBSD: patch-au,v 1.3 2021/07/04 07:57:13 jnemeth Exp $ --- sendmail/main.c.orig 2020-06-02 09:41:43.000000000 +0000 +++ sendmail/main.c @@@@ -153,6 +153,10 @@@@ int SyslogPrefixLen; /* estimated lengt } \ } +#if NAMED_BIND +struct __res_state sm_res; +#endif + int main(argc, argv, envp) int argc; @@@@ -215,6 +219,15 @@@@ main(argc, argv, envp) envp = environ; #endif +#if NAMED_BIND +# if NAMED_RESN + sm_res = *(struct __res_state *)sm_malloc(sizeof(struct __res_state)); + memset(&sm_res, 0, sizeof(struct __res_state)); +# else + sm_res = _res; +# endif +#endif + /* turn off profiling */ SM_PROF(0); @@@@ -697,21 +710,25 @@@@ main(argc, argv, envp) */ #if NAMED_BIND - if (!bitset(RES_INIT, _res.options)) + if (!bitset(RES_INIT, sm_res.options)) +# if NAMED_RESN + (void) res_ninit(&sm_res); +# else (void) res_init(); +# endif if (tTd(8, 8)) - _res.options |= RES_DEBUG; + sm_res.options |= RES_DEBUG; else - _res.options &= ~RES_DEBUG; + sm_res.options &= ~RES_DEBUG; # ifdef RES_NOALIASES - _res.options |= RES_NOALIASES; + sm_res.options |= RES_NOALIASES; # endif - TimeOuts.res_retry[RES_TO_DEFAULT] = _res.retry; - TimeOuts.res_retry[RES_TO_FIRST] = _res.retry; - TimeOuts.res_retry[RES_TO_NORMAL] = _res.retry; - TimeOuts.res_retrans[RES_TO_DEFAULT] = _res.retrans; - TimeOuts.res_retrans[RES_TO_FIRST] = _res.retrans; - TimeOuts.res_retrans[RES_TO_NORMAL] = _res.retrans; + TimeOuts.res_retry[RES_TO_DEFAULT] = sm_res.retry; + TimeOuts.res_retry[RES_TO_FIRST] = sm_res.retry; + TimeOuts.res_retry[RES_TO_NORMAL] = sm_res.retry; + TimeOuts.res_retrans[RES_TO_DEFAULT] = sm_res.retrans; + TimeOuts.res_retrans[RES_TO_FIRST] = sm_res.retrans; + TimeOuts.res_retrans[RES_TO_NORMAL] = sm_res.retrans; #endif /* NAMED_BIND */ errno = 0; @@@@ -1394,8 +1411,8 @@@@ main(argc, argv, envp) } #if NAMED_BIND - _res.retry = TimeOuts.res_retry[RES_TO_DEFAULT]; - _res.retrans = TimeOuts.res_retrans[RES_TO_DEFAULT]; + sm_res.retry = TimeOuts.res_retry[RES_TO_DEFAULT]; + sm_res.retrans = TimeOuts.res_retrans[RES_TO_DEFAULT]; #endif /* @@@@ -2944,8 +2961,8 @@@@ main(argc, argv, envp) sm_getla(); GrabTo = false; #if NAMED_BIND - _res.retry = TimeOuts.res_retry[RES_TO_FIRST]; - _res.retrans = TimeOuts.res_retrans[RES_TO_FIRST]; + sm_res.retry = TimeOuts.res_retry[RES_TO_FIRST]; + sm_res.retrans = TimeOuts.res_retrans[RES_TO_FIRST]; #endif next = e->e_sibling; e->e_sibling = NULL; @