diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2007-04-09 01:38:51 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2007-04-09 01:38:51 +0000 |
commit | 14e22b52d4375b164f9fa21c0ab3abd9837e823f (patch) | |
tree | 2a4f38ae8ba223f3bf2402f56d35c997e5af6db5 /contrib/sendmail/include/sm | |
parent | 0a9c74f73599b0ca2981b57815b436d1f6de6191 (diff) | |
download | FreeBSD-src-14e22b52d4375b164f9fa21c0ab3abd9837e823f.zip FreeBSD-src-14e22b52d4375b164f9fa21c0ab3abd9837e823f.tar.gz |
Import sendmail 8.14.1
Diffstat (limited to 'contrib/sendmail/include/sm')
-rw-r--r-- | contrib/sendmail/include/sm/conf.h | 89 | ||||
-rw-r--r-- | contrib/sendmail/include/sm/errstring.h | 6 | ||||
-rw-r--r-- | contrib/sendmail/include/sm/heap.h | 14 | ||||
-rw-r--r-- | contrib/sendmail/include/sm/ldap.h | 31 | ||||
-rw-r--r-- | contrib/sendmail/include/sm/misc.h | 19 | ||||
-rw-r--r-- | contrib/sendmail/include/sm/os/sm_os_qnx.h | 20 | ||||
-rw-r--r-- | contrib/sendmail/include/sm/sendmail.h | 24 | ||||
-rw-r--r-- | contrib/sendmail/include/sm/tailq.h | 153 |
8 files changed, 314 insertions, 42 deletions
diff --git a/contrib/sendmail/include/sm/conf.h b/contrib/sendmail/include/sm/conf.h index 919ff0d..4f05f33 100644 --- a/contrib/sendmail/include/sm/conf.h +++ b/contrib/sendmail/include/sm/conf.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2006 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2007 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -10,14 +10,16 @@ * the sendmail distribution. * * - * $Id: conf.h,v 1.128 2006/01/27 18:43:44 ca Exp $ + * $Id: conf.h,v 1.132 2007/03/21 23:56:18 ca Exp $ */ /* ** CONF.H -- All user-configurable parameters for sendmail ** -** Send updates to sendmail@Sendmail.ORG so they will be -** included in the next release. +** Send updates to Sendmail.ORG so they will be +** included in the next release; see +** http://www.sendmail.org/email-addresses.html +** for current e-mail address. */ #ifndef SM_CONF_H @@ -160,6 +162,8 @@ extern void hard_syslog(); */ # ifdef _AIX5 +# include <sys/signal.h> +# include <sys/wait.h> # define _AIX4 40300 # define SOCKADDR_LEN_T socklen_t /* e.g., arg#3 to accept, getsockname */ # define SOCKOPT_LEN_T socklen_t /* arg#5 to getsockopt */ @@ -444,6 +448,7 @@ typedef int pid_t; # define SMRSH_CMDDIR "/var/adm/sm.bin" # endif /* ! SMRSH_CMDDIR */ # define SL_FUDGE 34 /* fudge offset for SyslogPrefixLen */ +# define HASLDAPGETALIASBYNAME 1 /* added in S8 */ # endif /* SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) */ # if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) # define HASURANDOMDEV 1 /* /dev/[u]random added in S9 */ @@ -852,36 +857,64 @@ extern unsigned int sleepX __P((unsigned int seconds)); # endif /* __bsdi__ */ +# if defined(__QNX__) +# if defined(__QNXNTO__) +/* QNX 6 */ +# include <unix.h> +# define HASUNSETENV 1 /* has unsetenv(3) call */ +# define HASINITGROUPS 1 /* has initgroups(3) call */ +# define HASSETSID 1 /* has POSIX setsid(2) call */ +# define USESETEUID 1 /* has usable seteuid(2) call */ +# define HASFCHMOD 1 /* has fchmod(2) syscall */ +# define HASFCHOWN 1 /* has fchown(2) syscall */ +# define HASUNAME 1 /* has uname(2) syscall */ +# define HASSTRERROR 1 /* has strerror(3) */ +# define BSD4_4_SOCKADDR /* has sa_len */ +# define ERRLIST_PREDEFINED /* don't declare sys_errlist */ +# define NETLINK 1 /* supports AF_LINK */ +# define GIDSET_T gid_t +# define QUAD_T uint64_t +# define HASSNPRINTF 1 /* has snprintf(3) (all versions?) */ +# define HASGETUSERSHELL 0 + +/* +** We have a strrev() that doesn't allocate anything. +** Make sure the one here is used. +*/ + +# define strrev strrev_sendmail + +# else /* defined(__QNXNTO__) */ + /* ** QNX 4.2x ** Contributed by Glen McCready <glen@qnx.com>. ** -** Should work with all versions of QNX. +** Should work with all versions of QNX 4. */ -# if defined(__QNX__) -# include <unix.h> -# include <sys/select.h> -# undef NGROUPS_MAX -# define HASSETSID 1 /* has POSIX setsid(2) call */ -# define USESETEUID 1 /* has usable seteuid(2) call */ -# define HASFCHMOD 1 /* has fchmod(2) syscall */ -# define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ -# define HASSETREUID 1 /* has setreuid(2) call */ -# define HASSTRERROR 1 /* has strerror(3) */ -# define HASFLOCK 0 -# undef HASINITGROUPS /* has initgroups(3) call */ -# define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */ -# define IP_SRCROUTE 1 /* can check IP source routing */ -# define TZ_TYPE TZ_TMNAME /* use tmname variable */ -# define GIDSET_T gid_t -# define LA_TYPE LA_ZERO -# define SFS_TYPE SFS_NONE -# define SPT_TYPE SPT_REUSEARGV -# define SPT_PADCHAR '\0' /* pad process title with nulls */ -# define HASGETUSERSHELL 0 -# define E_PSEUDOBASE 512 -# define _FILE_H_INCLUDED +# include <unix.h> +# include <sys/select.h> +# undef NGROUPS_MAX +# define HASSETSID 1 /* has POSIX setsid(2) call */ +# define USESETEUID 1 /* has usable seteuid(2) call */ +# define HASFCHMOD 1 /* has fchmod(2) syscall */ +# define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ +# define HASSETREUID 1 /* has setreuid(2) call */ +# define HASSTRERROR 1 /* has strerror(3) */ +# define HASFLOCK 0 +# undef HASINITGROUPS /* has initgroups(3) call */ +# define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */ +# define IP_SRCROUTE 1 /* can check IP source routing */ +# define TZ_TYPE TZ_TMNAME /* use tmname variable */ +# define GIDSET_T gid_t +# define LA_TYPE LA_ZERO +# define SFS_TYPE SFS_NONE +# define SPT_TYPE SPT_REUSEARGV +# define SPT_PADCHAR '\0' /* pad process title with nulls */ +# define HASGETUSERSHELL 0 +# define _FILE_H_INCLUDED +# endif /* defined(__QNXNTO__) */ # endif /* defined(__QNX__) */ diff --git a/contrib/sendmail/include/sm/errstring.h b/contrib/sendmail/include/sm/errstring.h index 2b93732..1d41526 100644 --- a/contrib/sendmail/include/sm/errstring.h +++ b/contrib/sendmail/include/sm/errstring.h @@ -6,7 +6,7 @@ * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * - * $Id: errstring.h,v 1.9 2003/12/10 03:19:06 gshapiro Exp $ + * $Id: errstring.h,v 1.10 2007/03/21 23:56:19 ca Exp $ */ /* @@ -16,6 +16,10 @@ #ifndef SM_ERRSTRING_H # define SM_ERRSTRING_H +#if defined(__QNX__) +# define E_PSEUDOBASE 512 +#endif /* defined(__QNX__) */ + #include <errno.h> #if NEEDINTERRNO extern int errno; diff --git a/contrib/sendmail/include/sm/heap.h b/contrib/sendmail/include/sm/heap.h index 8b56370..cd346b3 100644 --- a/contrib/sendmail/include/sm/heap.h +++ b/contrib/sendmail/include/sm/heap.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. + * Copyright (c) 2000-2001, 2006 Sendmail, 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. * - * $Id: heap.h,v 1.22 2001/09/04 22:41:55 ca Exp $ + * $Id: heap.h,v 1.23 2006/08/15 00:53:46 ca Exp $ */ /* @@ -91,6 +91,16 @@ sm_fcalloc __P(( # define sm_heap_setgroup(g) (SmHeapGroup = (g)) # define sm_heap_newgroup() (SmHeapGroup = ++SmHeapMaxGroup) +#define SM_FREE(ptr) \ + do \ + { \ + if ((ptr) != NULL) \ + { \ + sm_free(ptr); \ + (ptr) = NULL; \ + } \ + } while (0) + extern int SmHeapGroup; extern int SmHeapMaxGroup; diff --git a/contrib/sendmail/include/sm/ldap.h b/contrib/sendmail/include/sm/ldap.h index 7db8355..63292f1 100644 --- a/contrib/sendmail/include/sm/ldap.h +++ b/contrib/sendmail/include/sm/ldap.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2001-2003, 2005 Sendmail, Inc. and its suppliers. + * Copyright (c) 2001-2003, 2005, 2006 Sendmail, 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. * - * $Id: ldap.h,v 1.28 2005/06/23 23:11:21 ca Exp $ + * $Id: ldap.h,v 1.32 2006/08/30 22:56:58 ca Exp $ */ #ifndef SM_LDAP_H @@ -17,7 +17,7 @@ /* ** NOTE: These should be changed from LDAPMAP_* to SM_LDAP_* -** in the next major release (8.13) of sendmail. +** in the next major release (8.x+1) of sendmail. */ # ifndef LDAPMAP_MAX_ATTR @@ -32,6 +32,13 @@ # if LDAPMAP +/* maximum number of arguments in a map lookup, see sendmail.h: MAX_MAP_ARGS */ +# define SM_LDAP_ARGS 10 + +/* error codes from sm_ldap_search*() */ +# define SM_LDAP_ERR (-1) /* generic error: ldap_search(3) */ +# define SM_LDAP_ERR_ARG_MISS (-2) /* an argument is missing */ + /* Attribute types */ # define SM_LDAP_ATTR_NONE (-1) # define SM_LDAP_ATTR_OBJCLASS 0 @@ -75,6 +82,7 @@ struct sm_ldap_struct int ldap_attr_type[LDAPMAP_MAX_ATTR + 1]; char *ldap_attr_needobjclass[LDAPMAP_MAX_ATTR + 1]; bool ldap_attrsonly; + bool ldap_multi_args; /* args for ldap_result */ struct timeval ldap_timeout; @@ -91,18 +99,18 @@ typedef struct sm_ldap_struct SM_LDAP_STRUCT; struct sm_ldap_recurse_entry { - char *lr_search; - int lr_type; - LDAPURLDesc *lr_ludp; - char **lr_attrs; - bool lr_done; + char *lr_search; + int lr_type; + LDAPURLDesc *lr_ludp; + char **lr_attrs; + bool lr_done; }; struct sm_ldap_recurse_list { - int lr_size; - int lr_cnt; - struct sm_ldap_recurse_entry **lr_data; + int lrl_size; + int lrl_cnt; + struct sm_ldap_recurse_entry **lrl_data; }; typedef struct sm_ldap_recurse_entry SM_LDAP_RECURSE_ENTRY; @@ -112,6 +120,7 @@ typedef struct sm_ldap_recurse_list SM_LDAP_RECURSE_LIST; extern void sm_ldap_clear __P((SM_LDAP_STRUCT *)); extern bool sm_ldap_start __P((char *, SM_LDAP_STRUCT *)); extern int sm_ldap_search __P((SM_LDAP_STRUCT *, char *)); +extern int sm_ldap_search_m __P((SM_LDAP_STRUCT *, char **)); extern int sm_ldap_results __P((SM_LDAP_STRUCT *, int, int, int, SM_RPOOL_T *, char **, int *, int *, SM_LDAP_RECURSE_LIST *)); diff --git a/contrib/sendmail/include/sm/misc.h b/contrib/sendmail/include/sm/misc.h new file mode 100644 index 0000000..a9d6637 --- /dev/null +++ b/contrib/sendmail/include/sm/misc.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2006 Sendmail, 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. + * + * $Id: misc.h,v 1.1 2006/06/28 23:57:59 ca Exp $ + */ + +#ifndef SM_MISC_H +# define SM_MISC_H 1 + +int sm_memstat_open __P((void)); +int sm_memstat_close __P((void)); +int sm_memstat_get __P((char *, long *)); + +#endif /* ! SM_MISC_H */ diff --git a/contrib/sendmail/include/sm/os/sm_os_qnx.h b/contrib/sendmail/include/sm/os/sm_os_qnx.h new file mode 100644 index 0000000..9769827 --- /dev/null +++ b/contrib/sendmail/include/sm/os/sm_os_qnx.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2007 Sendmail, 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. + * + * $Id: sm_os_qnx.h,v 1.1 2007/03/21 23:56:20 ca Exp $ + */ + +/* +** sm_os_qnx.h -- platform definitions for QNX +*/ + +#define SM_CONF_SYS_CDEFS_H 1 + +#ifndef SM_CONF_SETITIMER +# define SM_CONF_SETITIMER 0 +#endif /* SM_CONF_SETITIMER */ diff --git a/contrib/sendmail/include/sm/sendmail.h b/contrib/sendmail/include/sm/sendmail.h new file mode 100644 index 0000000..3008934 --- /dev/null +++ b/contrib/sendmail/include/sm/sendmail.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2006 Sendmail, 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. + */ + +/* +** SENDMAIL.H -- MTA-specific definitions for sendmail. +*/ + +#ifndef _SM_SENDMAIL_H +# define _SM_SENDMAIL_H 1 + +/* "out of band" indicator */ +#define METAQUOTE ((unsigned char)0377) /* quotes the next octet */ + +extern int dequote_internal_chars __P((char *, char *, int)); +extern char *quote_internal_chars __P((char *, char *, int *)); +extern char *str2prt __P((char *)); + +#endif /* ! _SM_SENDMAIL_H */ diff --git a/contrib/sendmail/include/sm/tailq.h b/contrib/sendmail/include/sm/tailq.h new file mode 100644 index 0000000..cfb09be --- /dev/null +++ b/contrib/sendmail/include/sm/tailq.h @@ -0,0 +1,153 @@ +/* $OpenBSD: queue.h,v 1.30 2005/10/25 06:37:47 otto Exp $ */ +/* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */ + +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)queue.h 8.5 (Berkeley) 8/20/94 + */ + +#ifndef SM_TAILQ_H_ +#define SM_TAILQ_H_ + +/* + * This file is a modified copy of queue.h from a BSD system: + * we only need tail queues here. + * + * A tail queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or + * after an existing element, at the head of the list, or at the end of + * the list. A tail queue may be traversed in either direction. + */ + +/* + * Tail queue definitions. + */ +#define SM_TAILQ_HEAD(name, type) \ +struct name { \ + struct type *tqh_first; /* first element */ \ + struct type **tqh_last; /* addr of last next element */ \ +} + +#define SM_TAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).tqh_first } + +#define SM_TAILQ_ENTRY(type) \ +struct { \ + struct type *tqe_next; /* next element */ \ + struct type **tqe_prev; /* address of previous next element */ \ +} + +/* + * tail queue access methods + */ +#define SM_TAILQ_FIRST(head) ((head)->tqh_first) +#define SM_TAILQ_END(head) NULL +#define SM_TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) +#define SM_TAILQ_LAST(head, headname) \ + (*(((struct headname *)((head)->tqh_last))->tqh_last)) +/* XXX */ +#define SM_TAILQ_PREV(elm, headname, field) \ + (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) +#define SM_TAILQ_EMPTY(head) \ + (SM_TAILQ_FIRST(head) == SM_TAILQ_END(head)) + +#define SM_TAILQ_FOREACH(var, head, field) \ + for((var) = SM_TAILQ_FIRST(head); \ + (var) != SM_TAILQ_END(head); \ + (var) = SM_TAILQ_NEXT(var, field)) + +#define SM_TAILQ_FOREACH_REVERSE(var, head, headname, field) \ + for((var) = SM_TAILQ_LAST(head, headname); \ + (var) != SM_TAILQ_END(head); \ + (var) = SM_TAILQ_PREV(var, headname, field)) + +/* + * Tail queue functions. + */ +#define SM_TAILQ_INIT(head) do { \ + (head)->tqh_first = NULL; \ + (head)->tqh_last = &(head)->tqh_first; \ +} while (0) + +#define SM_TAILQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ + (head)->tqh_first->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (head)->tqh_first = (elm); \ + (elm)->field.tqe_prev = &(head)->tqh_first; \ +} while (0) + +#define SM_TAILQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.tqe_next = NULL; \ + (elm)->field.tqe_prev = (head)->tqh_last; \ + *(head)->tqh_last = (elm); \ + (head)->tqh_last = &(elm)->field.tqe_next; \ +} while (0) + +#define SM_TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ + (elm)->field.tqe_next->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (listelm)->field.tqe_next = (elm); \ + (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ +} while (0) + +#define SM_TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ + (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ + (elm)->field.tqe_next = (listelm); \ + *(listelm)->field.tqe_prev = (elm); \ + (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ +} while (0) + +#define SM_TAILQ_REMOVE(head, elm, field) do { \ + if (((elm)->field.tqe_next) != NULL) \ + (elm)->field.tqe_next->field.tqe_prev = \ + (elm)->field.tqe_prev; \ + else \ + (head)->tqh_last = (elm)->field.tqe_prev; \ + *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ +} while (0) + +#define SM_TAILQ_REPLACE(head, elm, elm2, field) do { \ + if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != NULL) \ + (elm2)->field.tqe_next->field.tqe_prev = \ + &(elm2)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm2)->field.tqe_next; \ + (elm2)->field.tqe_prev = (elm)->field.tqe_prev; \ + *(elm2)->field.tqe_prev = (elm2); \ +} while (0) + +#endif /* !SM_TAILQ_H_ */ |