diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2002-06-11 21:12:04 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2002-06-11 21:12:04 +0000 |
commit | faacdfb2c2946459651449cedf08a1bc29aee731 (patch) | |
tree | 546131e3b171104de8ab1498603b992a6971ec6a /contrib/sendmail/libsmutil | |
parent | e226f8e879ed5a8d2f5cc433067b698e07dce0b6 (diff) | |
download | FreeBSD-src-faacdfb2c2946459651449cedf08a1bc29aee731.zip FreeBSD-src-faacdfb2c2946459651449cedf08a1bc29aee731.tar.gz |
Import sendmail 8.12.4
Diffstat (limited to 'contrib/sendmail/libsmutil')
-rw-r--r-- | contrib/sendmail/libsmutil/Makefile | 2 | ||||
-rw-r--r-- | contrib/sendmail/libsmutil/cf.c | 6 | ||||
-rw-r--r-- | contrib/sendmail/libsmutil/debug.c | 2 | ||||
-rw-r--r-- | contrib/sendmail/libsmutil/err.c | 2 | ||||
-rw-r--r-- | contrib/sendmail/libsmutil/lockfile.c | 2 | ||||
-rw-r--r-- | contrib/sendmail/libsmutil/safefile.c | 22 | ||||
-rw-r--r-- | contrib/sendmail/libsmutil/snprintf.c | 2 |
7 files changed, 23 insertions, 15 deletions
diff --git a/contrib/sendmail/libsmutil/Makefile b/contrib/sendmail/libsmutil/Makefile index 7538f2d..2de3231 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 67feb40..c2132c3 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 7b34928..2c3b328 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 7cd3e4b..0ad52a4 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 2a4d95a..5eca360 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 02b218f..aed40a0 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 11761b4..ff3aa3b 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 |