diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-01-01 19:59:25 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-01-01 19:59:25 +0000 |
commit | ca99f1ac04361a3826ef7aa2d09eff30344e9b15 (patch) | |
tree | 037fd2f9239003a4df00dbf76d8f53671ce45b78 /gnu/usr.sbin/sendmail/libsm | |
parent | e60a23b69678e8ea276e2e2f3e17ecc02b87d3cb (diff) |
update to sendmail 8.12.7
Diffstat (limited to 'gnu/usr.sbin/sendmail/libsm')
-rw-r--r-- | gnu/usr.sbin/sendmail/libsm/local.h | 7 | ||||
-rw-r--r-- | gnu/usr.sbin/sendmail/libsm/mbdb.c | 13 | ||||
-rw-r--r-- | gnu/usr.sbin/sendmail/libsm/refill.c | 7 | ||||
-rw-r--r-- | gnu/usr.sbin/sendmail/libsm/stdio.c | 10 |
4 files changed, 27 insertions, 10 deletions
diff --git a/gnu/usr.sbin/sendmail/libsm/local.h b/gnu/usr.sbin/sendmail/libsm/local.h index 669c4ea838b..93b21c27ade 100644 --- a/gnu/usr.sbin/sendmail/libsm/local.h +++ b/gnu/usr.sbin/sendmail/libsm/local.h @@ -11,7 +11,7 @@ * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * - * $Sendmail: local.h,v 1.51 2002/02/20 02:40:24 ca Exp $ + * $Sendmail: local.h,v 1.51.2.1 2002/09/09 21:38:08 gshapiro Exp $ */ /* @@ -279,6 +279,11 @@ extern const char SmFileMagic[]; sm_io_to.tv_sec = (to) / 1000; \ sm_io_to.tv_usec = ((to) - (sm_io_to.tv_sec * 1000)) * 10; \ } \ + if (FD_SETSIZE > 0 && (fd) >= FD_SETSIZE) \ + { \ + errno = EINVAL; \ + return SM_IO_EOF; \ + } \ FD_ZERO(&sm_io_to_mask); \ FD_SET((fd), &sm_io_to_mask); \ FD_ZERO(&sm_io_x_mask); \ diff --git a/gnu/usr.sbin/sendmail/libsm/mbdb.c b/gnu/usr.sbin/sendmail/libsm/mbdb.c index 32f3ebe6b44..0139f18fde5 100644 --- a/gnu/usr.sbin/sendmail/libsm/mbdb.c +++ b/gnu/usr.sbin/sendmail/libsm/mbdb.c @@ -8,7 +8,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Sendmail: mbdb.c,v 1.38 2002/04/05 22:59:56 gshapiro Exp $") +SM_RCSID("@(#)$Sendmail: mbdb.c,v 1.38.2.1 2002/11/20 22:59:06 gshapiro Exp $") #include <sys/param.h> @@ -17,6 +17,7 @@ SM_RCSID("@(#)$Sendmail: mbdb.c,v 1.38 2002/04/05 22:59:56 gshapiro Exp $") #include <pwd.h> #include <stdlib.h> #include <setjmp.h> +#include <unistd.h> #include <sm/limits.h> #include <sm/conf.h> @@ -466,10 +467,6 @@ mbdb_ldap_initialize(arg) } LDAPLMAP.ldap_base = new; } - - /* No connection yet, connect */ - if (!sm_ldap_start(MBDB_LDAP_LABEL, &LDAPLMAP)) - return EX_UNAVAILABLE; return EX_OK; } @@ -518,6 +515,12 @@ mbdb_ldap_lookup(name, user) return EX_TEMPFAIL; } + if (LDAPLMAP.ldap_pid != getpid()) + { + /* re-open map in this child process */ + LDAPLMAP.ldap_ld = NULL; + } + if (LDAPLMAP.ldap_ld == NULL) { /* map not open, try to open now */ diff --git a/gnu/usr.sbin/sendmail/libsm/refill.c b/gnu/usr.sbin/sendmail/libsm/refill.c index c51f3dd355d..7b2d518d3bc 100644 --- a/gnu/usr.sbin/sendmail/libsm/refill.c +++ b/gnu/usr.sbin/sendmail/libsm/refill.c @@ -13,7 +13,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Sendmail: refill.c,v 1.49 2001/09/11 04:04:49 gshapiro Exp $") +SM_RCSID("@(#)$Sendmail: refill.c,v 1.49.2.1 2002/09/09 21:38:08 gshapiro Exp $") #include <stdlib.h> #include <unistd.h> #include <errno.h> @@ -65,6 +65,11 @@ static int sm_lflush __P((SM_FILE_T *, int *)); errno = EAGAIN; \ return SM_IO_EOF; \ } \ + if (FD_SETSIZE > 0 && (fd) >= FD_SETSIZE) \ + { \ + errno = EINVAL; \ + return SM_IO_EOF; \ + } \ FD_ZERO(&sm_io_to_mask); \ FD_SET((fd), &sm_io_to_mask); \ FD_ZERO(&sm_io_x_mask); \ diff --git a/gnu/usr.sbin/sendmail/libsm/stdio.c b/gnu/usr.sbin/sendmail/libsm/stdio.c index bea481fe7e1..a4ed839b283 100644 --- a/gnu/usr.sbin/sendmail/libsm/stdio.c +++ b/gnu/usr.sbin/sendmail/libsm/stdio.c @@ -13,7 +13,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Sendmail: stdio.c,v 1.56 2002/04/03 21:55:15 ca Exp $") +SM_RCSID("@(#)$Sendmail: stdio.c,v 1.56.2.3 2002/10/22 23:07:19 ca Exp $") #include <unistd.h> #include <errno.h> #include <fcntl.h> @@ -24,9 +24,9 @@ SM_RCSID("@(#)$Sendmail: stdio.c,v 1.56 2002/04/03 21:55:15 ca Exp $") #include <sm/assert.h> #include <sm/varargs.h> #include <sm/io.h> -#include <sm/fdset.h> #include <sm/setjmp.h> #include <sm/conf.h> +#include <sm/fdset.h> #include "local.h" /* @@ -353,6 +353,11 @@ sm_stdgetinfo(fp, what, valp) fd_set readfds; struct timeval timeout; + if (SM_FD_SETSIZE > 0 && fp->f_file >= SM_FD_SETSIZE) + { + errno = EINVAL; + return -1; + } FD_ZERO(&readfds); SM_FD_SET(fp->f_file, &readfds); timeout.tv_sec = 0; @@ -422,7 +427,6 @@ sm_stdfdopen(fp, info, flags, rpool) /* Make sure the mode the user wants is a subset of the actual mode. */ if ((fdflags = fcntl(fd, F_GETFL, 0)) < 0) return -1; - tmp = fdflags & O_ACCMODE; if (tmp != O_RDWR && (tmp != (oflags & O_ACCMODE))) { |