aboutsummaryrefslogtreecommitdiff
path: root/contrib/sendmail/libsmutil
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/sendmail/libsmutil')
-rw-r--r--contrib/sendmail/libsmutil/Makefile2
-rw-r--r--contrib/sendmail/libsmutil/cf.c6
-rw-r--r--contrib/sendmail/libsmutil/debug.c2
-rw-r--r--contrib/sendmail/libsmutil/err.c2
-rw-r--r--contrib/sendmail/libsmutil/lockfile.c2
-rw-r--r--contrib/sendmail/libsmutil/safefile.c22
-rw-r--r--contrib/sendmail/libsmutil/snprintf.c2
7 files changed, 23 insertions, 15 deletions
diff --git a/contrib/sendmail/libsmutil/Makefile b/contrib/sendmail/libsmutil/Makefile
index 7538f2db3cc7..2de323192e3b 100644
--- a/contrib/sendmail/libsmutil/Makefile
+++ b/contrib/sendmail/libsmutil/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.1.1.1 2000/08/12 21:55:29 gshapiro Exp $
+# $Id: Makefile,v 8.2 1999/09/23 22:36:32 ca Exp $
SHELL= /bin/sh
BUILD= ./Build
diff --git a/contrib/sendmail/libsmutil/cf.c b/contrib/sendmail/libsmutil/cf.c
index 67feb40469a2..c2132c3f00c8 100644
--- a/contrib/sendmail/libsmutil/cf.c
+++ b/contrib/sendmail/libsmutil/cf.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 2000-2002 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -9,7 +9,7 @@
*/
#include <sendmail.h>
-SM_RCSID("@(#)$Id: cf.c,v 1.1.1.1 2002/02/17 21:56:42 gshapiro Exp $")
+SM_RCSID("@(#)$Id: cf.c,v 8.18 2002/05/25 00:09:16 gshapiro Exp $")
#include <sendmail/pathnames.h>
/*
@@ -60,7 +60,7 @@ getcfname(opmode, submitmode, cftype, conffile)
cftype != SM_GET_SENDMAIL_CF))
{
struct stat sbuf;
- static char cf[PATH_MAX];
+ static char cf[MAXPATHLEN];
(void) sm_strlcpyn(cf, sizeof cf, 2, _DIR_SENDMAILCF,
"submit.cf");
diff --git a/contrib/sendmail/libsmutil/debug.c b/contrib/sendmail/libsmutil/debug.c
index 7b34928392b4..2c3b3284ad5a 100644
--- a/contrib/sendmail/libsmutil/debug.c
+++ b/contrib/sendmail/libsmutil/debug.c
@@ -10,6 +10,6 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: debug.c,v 1.1.1.2 2002/02/17 21:56:42 gshapiro Exp $")
+SM_RCSID("@(#)$Id: debug.c,v 8.9 2001/09/11 04:04:55 gshapiro Exp $")
unsigned char tTdvect[100]; /* trace vector */
diff --git a/contrib/sendmail/libsmutil/err.c b/contrib/sendmail/libsmutil/err.c
index 7cd3e4baf7f2..0ad52a4a4a9b 100644
--- a/contrib/sendmail/libsmutil/err.c
+++ b/contrib/sendmail/libsmutil/err.c
@@ -10,7 +10,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: err.c,v 1.1.1.1 2002/02/17 21:56:42 gshapiro Exp $")
+SM_RCSID("@(#)$Id: err.c,v 8.5 2001/09/11 04:04:55 gshapiro Exp $")
#include <ctype.h>
diff --git a/contrib/sendmail/libsmutil/lockfile.c b/contrib/sendmail/libsmutil/lockfile.c
index 2a4d95a0e788..5eca360ce8f9 100644
--- a/contrib/sendmail/libsmutil/lockfile.c
+++ b/contrib/sendmail/libsmutil/lockfile.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: lockfile.c,v 1.1.1.3 2002/02/17 21:56:42 gshapiro Exp $")
+SM_RCSID("@(#)$Id: lockfile.c,v 8.19 2001/09/11 04:04:55 gshapiro Exp $")
/*
diff --git a/contrib/sendmail/libsmutil/safefile.c b/contrib/sendmail/libsmutil/safefile.c
index 02b218f8e27c..aed40a0482e0 100644
--- a/contrib/sendmail/libsmutil/safefile.c
+++ b/contrib/sendmail/libsmutil/safefile.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -15,7 +15,7 @@
#include <sm/io.h>
#include <sm/errstring.h>
-SM_RCSID("@(#)$Id: safefile.c,v 1.1.1.4 2002/02/17 21:56:42 gshapiro Exp $")
+SM_RCSID("@(#)$Id: safefile.c,v 8.124 2002/05/24 20:50:15 gshapiro Exp $")
/*
@@ -58,7 +58,7 @@ safefile(fn, uid, gid, user, flags, mode, st)
bool checkpath;
struct stat stbuf;
struct stat fstbuf;
- char fbuf[MAXPATHLEN + 1];
+ char fbuf[MAXPATHLEN];
if (tTd(44, 4))
sm_dprintf("safefile(%s, uid=%d, gid=%d, flags=%lx, mode=%o):\n",
@@ -406,7 +406,7 @@ safedirpath(fn, uid, gid, user, flags, level, offset)
char *saveptr = NULL;
char *p, *enddir;
register struct group *gr = NULL;
- char s[MAXLINKPATHLEN + 1];
+ char s[MAXLINKPATHLEN];
struct stat stbuf;
/* make sure we aren't in a symlink loop */
@@ -486,15 +486,23 @@ safedirpath(fn, uid, gid, user, flags, level, offset)
/* Follow symlinks */
if (S_ISLNK(stbuf.st_mode))
{
+ int linklen;
char *target;
- char buf[MAXPATHLEN + 1];
+ char buf[MAXPATHLEN];
memset(buf, '\0', sizeof buf);
- if (readlink(s, buf, sizeof buf) < 0)
+ linklen = readlink(s, buf, sizeof buf);
+ if (linklen < 0)
{
ret = errno;
break;
}
+ if (linklen >= sizeof buf)
+ {
+ /* file name too long for buffer */
+ ret = errno = EINVAL;
+ break;
+ }
offset = 0;
if (*buf == '/')
@@ -536,7 +544,7 @@ safedirpath(fn, uid, gid, user, flags, level, offset)
else
{
char *sptr;
- char fullbuf[MAXLINKPATHLEN + 1];
+ char fullbuf[MAXLINKPATHLEN];
sptr = strrchr(s, '/');
if (sptr != NULL)
diff --git a/contrib/sendmail/libsmutil/snprintf.c b/contrib/sendmail/libsmutil/snprintf.c
index 11761b493990..ff3aa3b90c7c 100644
--- a/contrib/sendmail/libsmutil/snprintf.c
+++ b/contrib/sendmail/libsmutil/snprintf.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: snprintf.c,v 1.1.1.4 2002/02/17 21:56:42 gshapiro Exp $")
+SM_RCSID("@(#)$Id: snprintf.c,v 8.44 2001/09/11 04:04:56 gshapiro Exp $")
/*
** SHORTENSTRING -- return short version of a string