summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/src
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2001-02-28 00:22:47 +0000
committergshapiro <gshapiro@FreeBSD.org>2001-02-28 00:22:47 +0000
commitd670e0b9fbf1569b78c7b526053c8f68bae130c3 (patch)
tree28bbd6f22cf59652f0a32ec670c83c5f12c960a9 /contrib/sendmail/src
parente4882e48c06ee9963c8275992cd9767a29e01c05 (diff)
downloadFreeBSD-src-d670e0b9fbf1569b78c7b526053c8f68bae130c3.zip
FreeBSD-src-d670e0b9fbf1569b78c7b526053c8f68bae130c3.tar.gz
Repair 8.11.3 merge conflicts
Diffstat (limited to 'contrib/sendmail/src')
-rw-r--r--contrib/sendmail/src/conf.c91
-rw-r--r--contrib/sendmail/src/conf.h20
-rw-r--r--contrib/sendmail/src/headers.c8
-rw-r--r--contrib/sendmail/src/savemail.c7
4 files changed, 89 insertions, 37 deletions
diff --git a/contrib/sendmail/src/conf.c b/contrib/sendmail/src/conf.c
index 61424f4..ab082f8 100644
--- a/contrib/sendmail/src/conf.c
+++ b/contrib/sendmail/src/conf.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -12,7 +12,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: conf.c,v 8.646.2.2.2.61 2000/12/28 23:46:41 gshapiro Exp $";
+static char id[] = "@(#)$Id: conf.c,v 8.646.2.2.2.69 2001/02/27 19:50:11 gshapiro Exp $";
#endif /* ! lint */
/* $FreeBSD$ */
@@ -4360,7 +4360,7 @@ getipnodebyname(name, family, flags, err)
resv6 = bitset(RES_USE_INET6, _res.options);
_res.options |= RES_USE_INET6;
}
- h_errno = 0;
+ SM_SET_H_ERRNO(0);
h = gethostbyname(name);
*err = h_errno;
if (family == AF_INET6 && !resv6)
@@ -4377,7 +4377,7 @@ getipnodebyaddr(addr, len, family, err)
{
struct hostent *h;
- h_errno = 0;
+ SM_SET_H_ERRNO(0);
h = gethostbyaddr(addr, len, family);
*err = h_errno;
return h;
@@ -4403,6 +4403,7 @@ sm_gethostbyname(name, family)
char *name;
int family;
{
+ int save_errno;
struct hostent *h = NULL;
#if (SOLARIS > 10000 && SOLARIS < 20400) || (defined(SOLARIS) && SOLARIS < 204) || (defined(sony_news) && defined(__svr4))
# if SOLARIS == 20300 || SOLARIS == 203
@@ -4413,12 +4414,14 @@ sm_gethostbyname(name, family)
if (tTd(61, 10))
dprintf("_switch_gethostbyname_r(%s)... ", name);
h = _switch_gethostbyname_r(name, &hp, buf, sizeof(buf), &h_errno);
+ save_errno = errno;
# else /* SOLARIS == 20300 || SOLARIS == 203 */
extern struct hostent *__switch_gethostbyname();
if (tTd(61, 10))
dprintf("__switch_gethostbyname(%s)... ", name);
h = __switch_gethostbyname(name);
+ save_errno = errno;
# endif /* SOLARIS == 20300 || SOLARIS == 203 */
#else /* (SOLARIS > 10000 && SOLARIS < 20400) || (defined(SOLARIS) && SOLARIS < 204) || (defined(sony_news) && defined(__svr4)) */
int nmaps;
@@ -4426,7 +4429,6 @@ sm_gethostbyname(name, family)
int flags = AI_DEFAULT|AI_ALL;
int err;
# endif /* NETINET6 */
- int save_errno;
char *maptype[MAXMAPSTACK];
short mapreturn[MAXMAPACTIONS];
char hbuf[MAXNAME];
@@ -4439,7 +4441,7 @@ sm_gethostbyname(name, family)
flags &= ~AI_ADDRCONFIG;
# endif /* ADDRCONFIG_IS_BROKEN */
h = getipnodebyname(name, family, flags, &err);
- h_errno = err;
+ SM_SET_H_ERRNO(err);
# else /* NETINET6 */
h = gethostbyname(name);
# endif /* NETINET6 */
@@ -4467,7 +4469,7 @@ sm_gethostbyname(name, family)
return NULL;
}
(void) strlcpy(hbuf, name, sizeof hbuf);
- shorten_hostname(hbuf);
+ (void) shorten_hostname(hbuf);
/* if it hasn't been shortened, there's no point */
if (strcmp(hbuf, name) != 0)
@@ -4480,7 +4482,7 @@ sm_gethostbyname(name, family)
h = getipnodebyname(hbuf, family,
AI_V4MAPPED|AI_ALL,
&err);
- h_errno = err;
+ SM_SET_H_ERRNO(err);
save_errno = errno;
# else /* NETINET6 */
h = gethostbyname(hbuf);
@@ -4543,26 +4545,42 @@ sm_gethostbyaddr(addr, len, type)
int type;
{
struct hostent *hp;
+
+#if NETINET6
+ if (type == AF_INET6 &&
+ IN6_IS_ADDR_UNSPECIFIED((struct in6_addr *) addr))
+ {
+ /* Avoid reverse lookup for IPv6 unspecified address */
+ SM_SET_H_ERRNO(HOST_NOT_FOUND);
+ return NULL;
+ }
+#endif /* NETINET6 */
+
#if (SOLARIS > 10000 && SOLARIS < 20400) || (defined(SOLARIS) && SOLARIS < 204)
# if SOLARIS == 20300 || SOLARIS == 203
- static struct hostent he;
- static char buf[1000];
- extern struct hostent *_switch_gethostbyaddr_r();
+ {
+ static struct hostent he;
+ static char buf[1000];
+ extern struct hostent *_switch_gethostbyaddr_r();
- hp = _switch_gethostbyaddr_r(addr, len, type, &he, buf, sizeof(buf), &h_errno);
+ hp = _switch_gethostbyaddr_r(addr, len, type, &he,
+ buf, sizeof(buf), &h_errno);
+ }
# else /* SOLARIS == 20300 || SOLARIS == 203 */
- extern struct hostent *__switch_gethostbyaddr();
+ {
+ extern struct hostent *__switch_gethostbyaddr();
- hp = __switch_gethostbyaddr(addr, len, type);
+ hp = __switch_gethostbyaddr(addr, len, type);
+ }
# endif /* SOLARIS == 20300 || SOLARIS == 203 */
#else /* (SOLARIS > 10000 && SOLARIS < 20400) || (defined(SOLARIS) && SOLARIS < 204) */
# if NETINET6
- int err;
-# endif /* NETINET6 */
+ {
+ int err;
-# if NETINET6
- hp = getipnodebyaddr(addr, len, type, &err);
- h_errno = err;
+ hp = getipnodebyaddr(addr, len, type, &err);
+ SM_SET_H_ERRNO(err);
+ }
# else /* NETINET6 */
hp = gethostbyaddr(addr, len, type);
# endif /* NETINET6 */
@@ -4937,18 +4955,21 @@ load_if_names()
switch (af)
{
case AF_INET6:
- ia6 = sa->sin6.sin6_addr;
-# ifdef __KAME__
- /* convert into proper scoped address - */
- if ((IN6_IS_ADDR_LINKLOCAL(&ia6) ||
- IN6_IS_ADDR_SITELOCAL(&ia6)) &&
+# ifdef __KAME__
+ /* convert into proper scoped address */
+ if ((IN6_IS_ADDR_LINKLOCAL(&sa->sin6.sin6_addr) ||
+ IN6_IS_ADDR_SITELOCAL(&sa->sin6.sin6_addr)) &&
sa->sin6.sin6_scope_id == 0)
{
- sa->sin6.sin6_scope_id = ntohs(ia6.s6_addr[3] |
- ((unsigned int) ia6.s6_addr[2] << 8));
- ia6.s6_addr[2] = ia6.s6_addr[3] = 0;
+ struct in6_addr *ia6p;
+
+ ia6p = &sa->sin6.sin6_addr;
+ sa->sin6.sin6_scope_id = ntohs(ia6p->s6_addr[3] |
+ ((unsigned int)ia6p->s6_addr[2] << 8));
+ ia6p->s6_addr[2] = ia6p->s6_addr[3] = 0;
}
-# endif /* __KAME__ */
+# endif /* __KAME__ */
+ ia6 = sa->sin6.sin6_addr;
if (IN6_IS_ADDR_UNSPECIFIED(&ia6))
{
addr = anynet_ntop(&ia6, buf6, sizeof buf6);
@@ -5131,6 +5152,20 @@ load_if_names()
# if NETINET6
case AF_INET6:
+# ifdef __KAME__
+ /* convert into proper scoped address */
+ if ((IN6_IS_ADDR_LINKLOCAL(&sa->sin6.sin6_addr) ||
+ IN6_IS_ADDR_SITELOCAL(&sa->sin6.sin6_addr)) &&
+ sa->sin6.sin6_scope_id == 0)
+ {
+ struct in6_addr *ia6p;
+
+ ia6p = &sa->sin6.sin6_addr;
+ sa->sin6.sin6_scope_id = ntohs(ia6p->s6_addr[3] |
+ ((unsigned int)ia6p->s6_addr[2] << 8));
+ ia6p->s6_addr[2] = ia6p->s6_addr[3] = 0;
+ }
+# endif /* __KAME__ */
ia6 = sa->sin6.sin6_addr;
if (IN6_IS_ADDR_UNSPECIFIED(&ia6))
{
diff --git a/contrib/sendmail/src/conf.h b/contrib/sendmail/src/conf.h
index 0eeecba..2b671e8 100644
--- a/contrib/sendmail/src/conf.h
+++ b/contrib/sendmail/src/conf.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -10,7 +10,7 @@
* the sendmail distribution.
*
*
- * $Id: conf.h,v 8.496.4.32 2000/12/15 19:20:53 gshapiro Exp $
+ * $Id: conf.h,v 8.496.4.37 2001/02/12 21:40:16 gshapiro Exp $
*/
/* $FreeBSD$ */
@@ -490,6 +490,9 @@ typedef int pid_t;
# endif /* ! __svr4__ */
# define GIDSET_T gid_t
# define USE_SA_SIGACTION 1 /* use sa_sigaction field */
+# if _FFR_MILTER
+# define BROKEN_PTHREAD_SLEEP 1 /* sleep after pthread_create() fails */
+# endif /* _FFR_MILTER */
# ifndef _PATH_UNIX
# define _PATH_UNIX "/dev/ksyms"
# endif /* ! _PATH_UNIX */
@@ -1006,6 +1009,12 @@ typedef int pid_t;
# define HASSTRL 0 /* strlcat(3) is broken in 2.5 and earlier */
# else /* OpenBSD < 199912 */
# define HASSTRL 1 /* has strlc{py,at}(3) functions */
+# if OpenBSD >= 200006
+# define HASSRANDOMDEV 1 /* has srandomdev(3) */
+# endif
+# if OpenBSD >= 200012
+# define HASSETUSERCONTEXT 1 /* BSDI-style login classes */
+# endif
# endif /* OpenBSD < 199912 */
# endif /* defined(__OpenBSD__) */
#endif /* defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */
@@ -1729,6 +1738,9 @@ typedef int pid_t;
# define _PATH_SENDMAILPID "/etc/sendmail.pid"
# endif /* ! _PATH_SENDMAILPID */
# undef offsetof /* avoid stddefs.h, sys/sysmacros.h conflict */
+#if !defined(SM_SET_H_ERRNO) && defined(_REENTRANT)
+# define SM_SET_H_ERRNO(err) set_h_errno((err))
+#endif /* ! SM_SET_H_ERRNO && _REENTRANT */
#endif /* __svr5__ */
/* ###################################################################### */
@@ -2724,6 +2736,10 @@ typedef void (*sigfunc_t) __P((int));
# define FORK fork /* function to call to fork mailer */
#endif /* ! FORK */
+/* setting h_errno */
+#ifndef SM_SET_H_ERRNO
+# define SM_SET_H_ERRNO(err) h_errno = (err)
+#endif /* SM_SET_H_ERRNO */
/* random routine -- set above using #ifdef _osname_ or in Makefile */
#if HASRANDOM
diff --git a/contrib/sendmail/src/headers.c b/contrib/sendmail/src/headers.c
index c45c00f..a39caea 100644
--- a/contrib/sendmail/src/headers.c
+++ b/contrib/sendmail/src/headers.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -12,7 +12,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: headers.c,v 8.203.4.10 2000/10/13 17:54:30 gshapiro Exp $";
+static char id[] = "@(#)$Id: headers.c,v 8.203.4.12 2001/01/22 19:00:22 gshapiro Exp $";
#endif /* ! lint */
/* $FreeBSD$ */
@@ -310,7 +310,7 @@ hse:
dp = qval;
l = 0;
dp[l++] = '"';
- for (sp = fvalue; *sp != '\0' && l < MAXNAME - 2; sp++)
+ for (sp = fvalue; *sp != '\0' && l < MAXNAME - 3; sp++)
{
switch(*sp)
{
@@ -339,7 +339,7 @@ hse:
if (LogLevel > 9)
sm_syslog(LOG_WARNING, e->e_id,
"Warning: truncated header '%s' before check with '%s' len=%d max=%d",
- fname, rs, l, MAXNAME);
+ fname, rs, l, MAXNAME - 1);
}
if ((sp = macvalue(macid("{currHeader}", NULL), e)) !=
NULL)
diff --git a/contrib/sendmail/src/savemail.c b/contrib/sendmail/src/savemail.c
index 8fbe30b..2d52e5e 100644
--- a/contrib/sendmail/src/savemail.c
+++ b/contrib/sendmail/src/savemail.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -12,7 +12,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: savemail.c,v 8.212.4.11 2000/12/18 18:00:44 ca Exp $";
+static char id[] = "@(#)$Id: savemail.c,v 8.212.4.12 2001/01/07 19:31:05 gshapiro Exp $";
#endif /* ! lint */
/* $FreeBSD$ */
@@ -1017,7 +1017,8 @@ errbody(mci, e, separator)
}
/* Reporting-MTA: is us (required) */
- (void) snprintf(buf, sizeof buf, "Reporting-MTA: dns; %.800s", MyHostName);
+ (void) snprintf(buf, sizeof buf, "Reporting-MTA: dns; %.800s",
+ MyHostName);
putline(buf, mci);
/* DSN-Gateway: not relevant since we are not translating */
OpenPOWER on IntegriCloud