From 574e70a7ab89c27012f2e53ff74c081ef90091e1 Mon Sep 17 00:00:00 2001 From: gshapiro Date: Thu, 9 Jul 2015 05:23:17 +0000 Subject: MFC: Merge sendmail 8.15.2 Approved by: re (gjb) --- contrib/sendmail/libsm/Makefile.m4 | 2 +- contrib/sendmail/libsm/errstring.c | 6 ++++-- contrib/sendmail/libsm/local.h | 3 ++- contrib/sendmail/libsm/mbdb.c | 4 ++-- contrib/sendmail/libsm/path.c | 15 --------------- contrib/sendmail/libsm/refill.c | 3 ++- contrib/sendmail/libsm/stdio.c | 2 +- contrib/sendmail/libsm/vfprintf.c | 2 +- 8 files changed, 13 insertions(+), 24 deletions(-) delete mode 100644 contrib/sendmail/libsm/path.c (limited to 'contrib/sendmail/libsm') 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 +#include #if !SM_CONF_MEMCHR # include #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_RCSID("@(#)$Id: path.c,v 1.10 2013-11-22 20:51:43 ca Exp $") - -#include -#include - 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 #include #include +#include #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 -- cgit v1.1