summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/libsm
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2015-07-09 05:23:17 +0000
committergshapiro <gshapiro@FreeBSD.org>2015-07-09 05:23:17 +0000
commit574e70a7ab89c27012f2e53ff74c081ef90091e1 (patch)
treed72b291cbd1817d0c82d74e0443d43d3086fb304 /contrib/sendmail/libsm
parent6fbe38a3cd2c5a390bea25327ee11f7e89fac99d (diff)
downloadFreeBSD-src-574e70a7ab89c27012f2e53ff74c081ef90091e1.zip
FreeBSD-src-574e70a7ab89c27012f2e53ff74c081ef90091e1.tar.gz
MFC: Merge sendmail 8.15.2
Approved by: re (gjb)
Diffstat (limited to 'contrib/sendmail/libsm')
-rw-r--r--contrib/sendmail/libsm/Makefile.m42
-rw-r--r--contrib/sendmail/libsm/errstring.c6
-rw-r--r--contrib/sendmail/libsm/local.h3
-rw-r--r--contrib/sendmail/libsm/mbdb.c4
-rw-r--r--contrib/sendmail/libsm/path.c15
-rw-r--r--contrib/sendmail/libsm/refill.c3
-rw-r--r--contrib/sendmail/libsm/stdio.c2
-rw-r--r--contrib/sendmail/libsm/vfprintf.c2
8 files changed, 13 insertions, 24 deletions
diff --git a/contrib/sendmail/libsm/Makefile.m4 b/contrib/sendmail/libsm/Makefile.m4
index 3901fe8..5882bb6 100644
--- a/contrib/sendmail/libsm/Makefile.m4
+++ b/contrib/sendmail/libsm/Makefile.m4
@@ -6,7 +6,7 @@ define(`confREQUIRE_LIBSM', `true')
define(`confREQUIRE_SM_OS_H', `true')
PREPENDDEF(`confENVDEF', `confMAPDEF')
bldPRODUCT_START(`library', `libsm')
-define(`bldSOURCES', ` assert.c debug.c errstring.c exc.c heap.c match.c rpool.c strdup.c strerror.c strl.c clrerr.c fclose.c feof.c ferror.c fflush.c fget.c fpos.c findfp.c flags.c fopen.c fprintf.c fpurge.c fput.c fread.c fscanf.c fseek.c fvwrite.c fwalk.c fwrite.c get.c makebuf.c put.c refill.c rewind.c setvbuf.c smstdio.c snprintf.c sscanf.c stdio.c strio.c ungetc.c vasprintf.c vfprintf.c vfscanf.c vprintf.c vsnprintf.c wbuf.c wsetup.c string.c stringf.c xtrap.c strto.c test.c path.c strcasecmp.c strrevcmp.c signal.c clock.c config.c shm.c sem.c mbdb.c strexit.c cf.c ldap.c niprop.c mpeix.c memstat.c util.c inet6_ntop.c ')
+define(`bldSOURCES', ` assert.c debug.c errstring.c exc.c heap.c match.c rpool.c strdup.c strerror.c strl.c clrerr.c fclose.c feof.c ferror.c fflush.c fget.c fpos.c findfp.c flags.c fopen.c fprintf.c fpurge.c fput.c fread.c fscanf.c fseek.c fvwrite.c fwalk.c fwrite.c get.c makebuf.c put.c refill.c rewind.c setvbuf.c smstdio.c snprintf.c sscanf.c stdio.c strio.c ungetc.c vasprintf.c vfprintf.c vfscanf.c vprintf.c vsnprintf.c wbuf.c wsetup.c string.c stringf.c xtrap.c strto.c test.c strcasecmp.c strrevcmp.c signal.c clock.c config.c shm.c sem.c mbdb.c strexit.c cf.c ldap.c niprop.c mpeix.c memstat.c util.c inet6_ntop.c ')
bldPRODUCT_END
dnl msg.c
dnl syslogio.c
diff --git a/contrib/sendmail/libsm/errstring.c b/contrib/sendmail/libsm/errstring.c
index 7233c5a..01d5a64 100644
--- a/contrib/sendmail/libsm/errstring.c
+++ b/contrib/sendmail/libsm/errstring.c
@@ -264,10 +264,12 @@ sm_errstring(errnum)
#if LDAPMAP
/*
- ** LDAP error messages.
+ ** LDAP error messages. Handle small negative errors from
+ ** libldap (in the range -E_LDAP_SHIM to zero, offset by E_LDAPBASE)
+ ** as well.
*/
- if (errnum >= E_LDAPBASE)
+ if (errnum >= E_LDAPBASE - E_LDAP_SHIM)
return ldap_err2string(errnum - E_LDAPBASE);
#endif /* LDAPMAP */
diff --git a/contrib/sendmail/libsm/local.h b/contrib/sendmail/libsm/local.h
index 8532ad8..304a52e 100644
--- a/contrib/sendmail/libsm/local.h
+++ b/contrib/sendmail/libsm/local.h
@@ -20,6 +20,7 @@
*/
#include <sm/time.h>
+#include <sm/fdset.h>
#if !SM_CONF_MEMCHR
# include <memory.h>
#endif /* !SM_CONF_MEMCHR */
@@ -244,7 +245,7 @@ int sm_flags __P((int));
sm_io_to.tv_sec = (to) / 1000; \
sm_io_to.tv_usec = ((to) - (sm_io_to.tv_sec * 1000)) * 1000; \
} \
- if (FD_SETSIZE > 0 && (fd) >= FD_SETSIZE) \
+ if (!SM_FD_OK_SELECT(fd)) \
{ \
errno = EINVAL; \
return SM_IO_EOF; \
diff --git a/contrib/sendmail/libsm/mbdb.c b/contrib/sendmail/libsm/mbdb.c
index d68d3b1..3d7426c 100644
--- a/contrib/sendmail/libsm/mbdb.c
+++ b/contrib/sendmail/libsm/mbdb.c
@@ -315,7 +315,7 @@ mbdb_pw_lookup(name, user)
{
struct passwd *pw;
-#ifdef HESIOD
+#if HESIOD && !HESIOD_ALLOW_NUMERIC_LOGIN
/* DEC Hesiod getpwnam accepts numeric strings -- short circuit it */
{
char *p;
@@ -326,7 +326,7 @@ mbdb_pw_lookup(name, user)
if (*p == '\0')
return EX_NOUSER;
}
-#endif /* HESIOD */
+#endif /* HESIOD && !HESIOD_ALLOW_NUMERIC_LOGIN */
errno = 0;
pw = getpwnam(name);
diff --git a/contrib/sendmail/libsm/path.c b/contrib/sendmail/libsm/path.c
deleted file mode 100644
index 0819c3e..0000000
--- a/contrib/sendmail/libsm/path.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright (c) 2000-2001 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.
- */
-
-#include <sm/gen.h>
-SM_RCSID("@(#)$Id: path.c,v 1.10 2013-11-22 20:51:43 ca Exp $")
-
-#include <sm/path.h>
-#include <sm/string.h>
-
diff --git a/contrib/sendmail/libsm/refill.c b/contrib/sendmail/libsm/refill.c
index 43eee97..e13c831 100644
--- a/contrib/sendmail/libsm/refill.c
+++ b/contrib/sendmail/libsm/refill.c
@@ -25,6 +25,7 @@ SM_RCSID("@(#)$Id: refill.c,v 1.54 2013-11-22 20:51:43 ca Exp $")
#include <sm/io.h>
#include <sm/conf.h>
#include <sm/assert.h>
+#include <sm/fdset.h>
#include "local.h"
static int sm_lflush __P((SM_FILE_T *, int *));
@@ -65,7 +66,7 @@ static int sm_lflush __P((SM_FILE_T *, int *));
errno = EAGAIN; \
return SM_IO_EOF; \
} \
- if (FD_SETSIZE > 0 && (fd) >= FD_SETSIZE) \
+ if (!SM_FD_OK_SELECT(fd)) \
{ \
errno = EINVAL; \
return SM_IO_EOF; \
diff --git a/contrib/sendmail/libsm/stdio.c b/contrib/sendmail/libsm/stdio.c
index a13f2ff..16277c0 100644
--- a/contrib/sendmail/libsm/stdio.c
+++ b/contrib/sendmail/libsm/stdio.c
@@ -317,7 +317,7 @@ sm_stdsetinfo(fp, what, valp)
}
/*
-** SM_GETINFO -- get information about the open file
+** SM_STDGETINFO -- get information about the open file
**
** Parameters:
** fp -- file to get info for
diff --git a/contrib/sendmail/libsm/vfprintf.c b/contrib/sendmail/libsm/vfprintf.c
index 860938d..87c353c 100644
--- a/contrib/sendmail/libsm/vfprintf.c
+++ b/contrib/sendmail/libsm/vfprintf.c
@@ -156,7 +156,7 @@ sm_bprintf(fp, fmt, ap)
#define FPT 0x100 /* Floating point number */
/*
-** SM_IO_VPRINTF -- performs actual formating for o/p
+** SM_IO_VFPRINTF -- performs actual formating for o/p
**
** Parameters:
** fp -- file pointer for o/p
OpenPOWER on IntegriCloud