aboutsummaryrefslogtreecommitdiff
path: root/contrib/sendmail/include
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/sendmail/include')
-rw-r--r--contrib/sendmail/include/libmilter/mfapi.h2
-rw-r--r--contrib/sendmail/include/libsmdb/smdb.h6
-rw-r--r--contrib/sendmail/include/sendmail/pathnames.h2
-rw-r--r--contrib/sendmail/include/sm/bdb.h4
-rw-r--r--contrib/sendmail/include/sm/conf.h1
-rw-r--r--contrib/sendmail/include/sm/gen.h12
-rw-r--r--contrib/sendmail/include/sm/ixlen.h43
-rw-r--r--contrib/sendmail/include/sm/notify.h5
-rw-r--r--contrib/sendmail/include/sm/os/sm_os_freebsd.h5
-rw-r--r--contrib/sendmail/include/sm/os/sm_os_openbsd.h20
-rw-r--r--contrib/sendmail/include/sm/rpool.h10
-rw-r--r--contrib/sendmail/include/sm/sem.h2
-rw-r--r--contrib/sendmail/include/sm/sendmail.h24
-rw-r--r--contrib/sendmail/include/sm/shm.h2
-rw-r--r--contrib/sendmail/include/sm/sysexits.h4
-rw-r--r--contrib/sendmail/include/sm/time.h2
16 files changed, 126 insertions, 18 deletions
diff --git a/contrib/sendmail/include/libmilter/mfapi.h b/contrib/sendmail/include/libmilter/mfapi.h
index 2b012d86af2b..3bb4c1d2a1d2 100644
--- a/contrib/sendmail/include/libmilter/mfapi.h
+++ b/contrib/sendmail/include/libmilter/mfapi.h
@@ -476,7 +476,7 @@ LIBMILTER_API int smfi_insheader __P((SMFICTX *, int, char *, char *));
** as a result of adding this header.
**
** SMFICTX *ctx; Opaque context structure
-** int idx; index into the header list where the insertion should happen
+** int idx; index into the header list where the insertion should happen
** char *headerh; Header field name
** char *headerv; Header field value
*/
diff --git a/contrib/sendmail/include/libsmdb/smdb.h b/contrib/sendmail/include/libsmdb/smdb.h
index 427599ce206c..bf102695a77b 100644
--- a/contrib/sendmail/include/libsmdb/smdb.h
+++ b/contrib/sendmail/include/libsmdb/smdb.h
@@ -357,12 +357,12 @@ extern smdb_open_func smdb_open_database;
# if NEWDB
extern smdb_open_func smdb_db_open;
# else
-# define smdb_db_open NULL
+# define smdb_db_open NULL
# endif
# if NDBM
extern smdb_open_func smdb_ndbm_open;
# else
-# define smdb_ndbm_open NULL
+# define smdb_ndbm_open NULL
# endif
extern int smdb_add_extension __P((char *, int, char *, char *));
extern int smdb_setup_file __P((char *, char *, int, long,
@@ -380,6 +380,6 @@ extern int smdb_unlock_map __P((SMDB_DATABASE *));
# if CDB
extern smdb_open_func smdb_cdb_open;
# else
-# define smdb_cdb_open NULL
+# define smdb_cdb_open NULL
# endif
#endif /* ! _SMDB_H_ */
diff --git a/contrib/sendmail/include/sendmail/pathnames.h b/contrib/sendmail/include/sendmail/pathnames.h
index 67be3a2d0184..2ac15cdd118b 100644
--- a/contrib/sendmail/include/sendmail/pathnames.h
+++ b/contrib/sendmail/include/sendmail/pathnames.h
@@ -33,7 +33,7 @@
# endif /* ! _PATH_SENDMAILPID */
# ifndef _PATH_SENDMAIL
-# define _PATH_SENDMAIL "/usr/lib/sendmail"
+# define _PATH_SENDMAIL "/usr/lib/sendmail"
# endif
# ifndef _PATH_MAILDIR
diff --git a/contrib/sendmail/include/sm/bdb.h b/contrib/sendmail/include/sm/bdb.h
index 832de252ca65..2c712d9664dc 100644
--- a/contrib/sendmail/include/sm/bdb.h
+++ b/contrib/sendmail/include/sm/bdb.h
@@ -37,9 +37,9 @@
# define DBTXN
# if !HASFLOCK && defined(DB_FCNTL_LOCKING)
# define SM_DB_FLAG_ADD(flag) (flag) |= DB_FCNTL_LOCKING
-# else /* !HASFLOCK && defined(DB_FCNTL_LOCKING) */
+# else
# define SM_DB_FLAG_ADD(flag) ((void) 0)
-# endif /* !HASFLOCK && defined(DB_FCNTL_LOCKING) */
+# endif
# endif /* (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1) || DB_VERSION_MAJOR >= 5 */
#endif /* NEWDB */
diff --git a/contrib/sendmail/include/sm/conf.h b/contrib/sendmail/include/sm/conf.h
index 7bb031bb0bc0..be9f027cac33 100644
--- a/contrib/sendmail/include/sm/conf.h
+++ b/contrib/sendmail/include/sm/conf.h
@@ -997,6 +997,7 @@ extern unsigned int sleepX __P((unsigned int seconds));
# define USESYSCTL 1 /* use sysctl(3) for getting ncpus */
# include <sys/param.h>
# include <sys/sysctl.h>
+# define HAVE_IFC_BUF_VOID 1 /* void *ifc_buf instead of caddr_t */
# endif
# if defined(__DragonFly__)
# define HASSETLOGIN 1 /* has setlogin(2) */
diff --git a/contrib/sendmail/include/sm/gen.h b/contrib/sendmail/include/sm/gen.h
index a66bae54b46c..4f2066fa7447 100644
--- a/contrib/sendmail/include/sm/gen.h
+++ b/contrib/sendmail/include/sm/gen.h
@@ -77,4 +77,16 @@
typedef int SM_ATOMIC_INT_T;
typedef unsigned int SM_ATOMIC_UINT_T;
+#if _FFR_EAI && !defined(USE_EAI)
+# define USE_EAI 1
+#endif
+
+#if USE_EAI && !defined(_FFR_LOGASIS)
+# define _FFR_LOGASIS 1
+#endif
+
+#if USE_EAI || _FFR_EIGHT_BIT_ADDR_OK
+# define _FFR_8BITENVADDR 1
+#endif
+
#endif /* SM_GEN_H */
diff --git a/contrib/sendmail/include/sm/ixlen.h b/contrib/sendmail/include/sm/ixlen.h
new file mode 100644
index 000000000000..c3090ee07bbe
--- /dev/null
+++ b/contrib/sendmail/include/sm/ixlen.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2020 Proofpoint, Inc. and its suppliers.
+ * All rights reserved.
+ *
+ * By using this file, you agree to the terms and conditions set
+ * forth in the LICENSE file which can be found at the top level of
+ * the sendmail distribution.
+ */
+
+#ifndef _SM_IXLEN_H
+# define _SM_IXLEN_H 1
+
+#define SM_IS_MQ(ch) (((ch) & 0377) == METAQUOTE)
+
+#if _FFR_8BITENVADDR
+# define XLENDECL bool mq=false; \
+ int xlen = 0;
+# define XLENRESET mq=false, xlen = 0
+# define XLEN(c) do { \
+ if (mq) { ++xlen; mq=false; } \
+ else if (SM_IS_MQ(c)) mq=true; \
+ else ++xlen; \
+ } while (0)
+
+extern int ilenx __P((const char *));
+extern int xleni __P((const char *));
+
+# if USE_EAI
+extern bool asciistr __P((const char *));
+extern int uxtext_unquote __P((const char *, char *, int));
+extern char *sm_lowercase __P((const char *));
+extern bool utf8_valid __P((const char *, size_t));
+# endif
+
+#else /* _FFR_8BITENVADDR */
+# define XLENDECL int xlen = 0;
+# define XLENRESET xlen = 0
+# define XLEN(c) ++xlen
+# define ilenx(str) strlen(str)
+# define xleni(str) strlen(str)
+#endif /* _FFR_8BITENVADDR */
+
+#endif /* ! _SM_IXLEN_H */
diff --git a/contrib/sendmail/include/sm/notify.h b/contrib/sendmail/include/sm/notify.h
index e5c193e09b37..4256ea94e747 100644
--- a/contrib/sendmail/include/sm/notify.h
+++ b/contrib/sendmail/include/sm/notify.h
@@ -10,10 +10,13 @@
#ifndef SM_NOTIFY_H
#define SM_NOTIFY_H
+/* microseconds */
+#define SM_MICROS 1000000L
+
int sm_notify_init __P((int));
int sm_notify_start __P((bool, int));
int sm_notify_stop __P((bool, int));
-int sm_notify_rcv __P((char *, size_t, int));
+int sm_notify_rcv __P((char *, size_t, long));
int sm_notify_snd __P((char *, size_t));
#endif /* ! SM_MSG_H */
diff --git a/contrib/sendmail/include/sm/os/sm_os_freebsd.h b/contrib/sendmail/include/sm/os/sm_os_freebsd.h
index 9c355c9be8e0..fb00760a4301 100644
--- a/contrib/sendmail/include/sm/os/sm_os_freebsd.h
+++ b/contrib/sendmail/include/sm/os/sm_os_freebsd.h
@@ -26,6 +26,11 @@
# define SM_CONF_STRL 1
# endif
# endif
+# if __FreeBSD_version >= 1200059
+# ifndef SM_CONF_SEM
+# define SM_CONF_SEM 2 /* union semun is no longer declared by default */
+# endif
+# endif
#endif
#ifndef SM_CONF_SHM
diff --git a/contrib/sendmail/include/sm/os/sm_os_openbsd.h b/contrib/sendmail/include/sm/os/sm_os_openbsd.h
index a1d94e949c3f..21e0a1010852 100644
--- a/contrib/sendmail/include/sm/os/sm_os_openbsd.h
+++ b/contrib/sendmail/include/sm/os/sm_os_openbsd.h
@@ -18,13 +18,27 @@
#define SM_OS_NAME "openbsd"
+/*
+** Temporary HACK for newer icu4c versions which include stdbool.h:
+** pretend that it is already included
+** otherwise compilation will break because bool is then
+** redefined between the prototype declaration and
+** the function definition, e.g.,
+** lowercase.c: error: conflicting types for 'asciistr'
+** ../../include/sm/ixlen.h:29:13: note: previous declaration is here
+*/
+
+#if USE_EAI && !SM_CONF_STDBOOL_H
+# define _STDBOOL_H_ 1
+#endif
+
#define SM_CONF_SYS_CDEFS_H 1
#ifndef SM_CONF_SHM
# define SM_CONF_SHM 1
-#endif /* SM_CONF_SHM */
+#endif
#ifndef SM_CONF_SEM
# define SM_CONF_SEM 1
-#endif /* SM_CONF_SEM */
+#endif
#ifndef SM_CONF_MSG
# define SM_CONF_MSG 1
-#endif /* SM_CONF_MSG */
+#endif
diff --git a/contrib/sendmail/include/sm/rpool.h b/contrib/sendmail/include/sm/rpool.h
index 52f76771321a..833474d9c911 100644
--- a/contrib/sendmail/include/sm/rpool.h
+++ b/contrib/sendmail/include/sm/rpool.h
@@ -15,7 +15,7 @@
*/
#ifndef SM_RPOOL_H
-# define SM_RPOOL_H
+# define SM_RPOOL_H 1
# include <sm/gen.h>
# include <sm/heap.h>
@@ -166,7 +166,15 @@ sm_rpool_malloc __P((
# endif /* SM_HEAP_CHECK */
#if DO_NOT_USE_STRCPY
+
+# if SM_HEAP_CHECK > 2
+extern char *sm_rpool_strdup_tagged_x __P((SM_RPOOL_T *rpool, const char *s, char *, int, int));
+# define sm_rpool_strdup_x(rpool, str) sm_rpool_strdup_tagged_x(rpool, str, "sm_rpool_strdup_x:" __FILE__, __LINE__, SmHeapGroup)
+# else
extern char *sm_rpool_strdup_x __P((SM_RPOOL_T *rpool, const char *s));
+# define sm_rpool_strdup_tagged_x(rpool, str, tag, line, group) sm_rpool_strdup_x(rpool, str)
+# endif
+
#else
# define sm_rpool_strdup_x(rpool, str) \
strcpy(sm_rpool_malloc_x(rpool, strlen(str) + 1), str)
diff --git a/contrib/sendmail/include/sm/sem.h b/contrib/sendmail/include/sm/sem.h
index f188a15deca3..548ee0858ff4 100644
--- a/contrib/sendmail/include/sm/sem.h
+++ b/contrib/sendmail/include/sm/sem.h
@@ -47,7 +47,7 @@ extern int sm_sem_stop __P((int));
extern int sm_sem_acq __P((int, int, int));
extern int sm_sem_rel __P((int, int, int));
extern int sm_sem_get __P((int, int));
-extern int sm_semsetowner __P((int, uid_t, gid_t, mode_t));
+extern int sm_semsetowner __P((int, uid_t, gid_t, MODE_T));
# else /* SM_CONF_SEM > 0 */
# define sm_sem_start(key, nsem, semflg, owner) 0
diff --git a/contrib/sendmail/include/sm/sendmail.h b/contrib/sendmail/include/sm/sendmail.h
index 56a247f92183..8913b32d4fb4 100644
--- a/contrib/sendmail/include/sm/sendmail.h
+++ b/contrib/sendmail/include/sm/sendmail.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 Proofpoint, Inc. and its suppliers.
+ * Copyright (c) 2006, 2020 Proofpoint, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -14,11 +14,31 @@
#ifndef _SM_SENDMAIL_H
# define _SM_SENDMAIL_H 1
+#include <sm/rpool.h>
+
/* "out of band" indicator */
#define METAQUOTE ((unsigned char)0377) /* quotes the next octet */
+#define SM_MM_QUOTE(ch) (((ch) & 0377) == METAQUOTE || (((ch) & 0340) == 0200))
extern int dequote_internal_chars __P((char *, char *, int));
-extern char *quote_internal_chars __P((char *, char *, int *));
+#if SM_HEAP_CHECK > 2
+extern char *quote_internal_chars_tagged __P((char *, char *, int *, SM_RPOOL_T *, char *, int, int));
+# define quote_internal_chars(ibp, obp, bsp, rpool) quote_internal_chars_tagged(ibp, obp, bsp, rpool, "quote_internal_chars:" __FILE__, __LINE__, SmHeapGroup)
+#else
+extern char *quote_internal_chars __P((char *, char *, int *, SM_RPOOL_T *));
+# define quote_internal_chars_tagged(ibp, obp, bsp, rpool, file, line, group) quote_internal_chars(ibp, obp, bsp, rpool)
+#endif
extern char *str2prt __P((char *));
+extern char *makelower __P((char *));
+#if USE_EAI
+extern bool sm_strcaseeq __P((const char *, const char *));
+extern bool sm_strncaseeq __P((const char *, const char *, size_t));
+# define SM_STRCASEEQ(a, b) sm_strcaseeq((a), (b))
+# define SM_STRNCASEEQ(a, b, n) sm_strncaseeq((a), (b), (n))
+#else
+# define SM_STRCASEEQ(a, b) (sm_strcasecmp((a), (b)) == 0)
+# define SM_STRNCASEEQ(a, b, n) (sm_strncasecmp((a), (b), (n)) == 0)
+#endif
+
#endif /* ! _SM_SENDMAIL_H */
diff --git a/contrib/sendmail/include/sm/shm.h b/contrib/sendmail/include/sm/shm.h
index f6c5ad56c1c9..2ee0fdbc9387 100644
--- a/contrib/sendmail/include/sm/shm.h
+++ b/contrib/sendmail/include/sm/shm.h
@@ -28,7 +28,7 @@
extern void *sm_shmstart __P((key_t, int , int , int *, bool));
extern int sm_shmstop __P((void *, int, bool));
-extern int sm_shmsetowner __P((int, uid_t, gid_t, mode_t));
+extern int sm_shmsetowner __P((int, uid_t, gid_t, MODE_T));
/* for those braindead systems... (e.g., SunOS 4) */
diff --git a/contrib/sendmail/include/sm/sysexits.h b/contrib/sendmail/include/sm/sysexits.h
index 53767d54e7c4..0505e8a0c3e0 100644
--- a/contrib/sendmail/include/sm/sysexits.h
+++ b/contrib/sendmail/include/sm/sysexits.h
@@ -74,6 +74,10 @@
** CANTCREAT, but rather for higher level permissions.
*/
+# ifdef EX_OK
+# undef EX_OK /* for SVr4.2 SMP */
+# endif
+
# if SM_CONF_SYSEXITS_H
# include <sysexits.h>
# else /* SM_CONF_SYSEXITS_H */
diff --git a/contrib/sendmail/include/sm/time.h b/contrib/sendmail/include/sm/time.h
index b6d31a4bd292..40134fdb557c 100644
--- a/contrib/sendmail/include/sm/time.h
+++ b/contrib/sendmail/include/sm/time.h
@@ -13,7 +13,6 @@
# define SM_TIME_H 1
# include <sm/config.h>
-
# include <sys/time.h>
/* should be defined in sys/time.h */
@@ -52,5 +51,4 @@
((tvp)->tv_sec cmp (uvp)->tv_sec))
#endif /* !timercmp */
-
#endif /* ! SM_TIME_H */