summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/libsm
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2003-02-08 20:31:29 +0000
committergshapiro <gshapiro@FreeBSD.org>2003-02-08 20:31:29 +0000
commit842b56b9cabf175e7842ec5a3b29ff68353b3177 (patch)
tree2e81c43d391ed220f6656502de14ddfbb0de4ecd /contrib/sendmail/libsm
parent39e311b2e17a53f7ed02fcbe3820ca77b65486d5 (diff)
downloadFreeBSD-src-842b56b9cabf175e7842ec5a3b29ff68353b3177.zip
FreeBSD-src-842b56b9cabf175e7842ec5a3b29ff68353b3177.tar.gz
Import sendmail 8.12.7
Diffstat (limited to 'contrib/sendmail/libsm')
-rw-r--r--contrib/sendmail/libsm/local.h7
-rw-r--r--contrib/sendmail/libsm/mbdb.c13
-rw-r--r--contrib/sendmail/libsm/refill.c7
-rw-r--r--contrib/sendmail/libsm/stdio.c10
4 files changed, 27 insertions, 10 deletions
diff --git a/contrib/sendmail/libsm/local.h b/contrib/sendmail/libsm/local.h
index 9433213..95b5ffe 100644
--- a/contrib/sendmail/libsm/local.h
+++ b/contrib/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.
*
- * $Id: local.h,v 1.51 2002/02/20 02:40:24 ca Exp $
+ * $Id: 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/contrib/sendmail/libsm/mbdb.c b/contrib/sendmail/libsm/mbdb.c
index 9e1ec63..0c338fe 100644
--- a/contrib/sendmail/libsm/mbdb.c
+++ b/contrib/sendmail/libsm/mbdb.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: mbdb.c,v 1.38 2002/04/05 22:59:56 gshapiro Exp $")
+SM_RCSID("@(#)$Id: 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("@(#)$Id: 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/contrib/sendmail/libsm/refill.c b/contrib/sendmail/libsm/refill.c
index 10c7cde..6e06783 100644
--- a/contrib/sendmail/libsm/refill.c
+++ b/contrib/sendmail/libsm/refill.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: refill.c,v 1.49 2001/09/11 04:04:49 gshapiro Exp $")
+SM_RCSID("@(#)$Id: 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/contrib/sendmail/libsm/stdio.c b/contrib/sendmail/libsm/stdio.c
index c3ab72d..0e5165f 100644
--- a/contrib/sendmail/libsm/stdio.c
+++ b/contrib/sendmail/libsm/stdio.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: stdio.c,v 1.56 2002/04/03 21:55:15 ca Exp $")
+SM_RCSID("@(#)$Id: 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("@(#)$Id: 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)))
{
OpenPOWER on IntegriCloud