From faacdfb2c2946459651449cedf08a1bc29aee731 Mon Sep 17 00:00:00 2001 From: gshapiro Date: Tue, 11 Jun 2002 21:12:04 +0000 Subject: Import sendmail 8.12.4 --- contrib/sendmail/src/alias.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'contrib/sendmail/src/alias.c') diff --git a/contrib/sendmail/src/alias.c b/contrib/sendmail/src/alias.c index 4d43908..f5bd746 100644 --- a/contrib/sendmail/src/alias.c +++ b/contrib/sendmail/src/alias.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 @@ -13,7 +13,7 @@ #include -SM_RCSID("@(#)$Id: alias.c,v 1.1.1.7 2002/02/17 21:56:38 gshapiro Exp $") +SM_RCSID("@(#)$Id: alias.c,v 8.214 2002/05/24 20:50:16 gshapiro Exp $") #define SEPARATOR ':' # define ALIAS_SPEC_SEPARATORS " ,/:" @@ -393,7 +393,7 @@ aliaswait(map, ext, isopen) bool attimeout = false; time_t mtime; struct stat stb; - char buf[MAXNAME + 1]; + char buf[MAXPATHLEN]; if (tTd(27, 3)) sm_dprintf("aliaswait(%s:%s)\n", @@ -458,8 +458,17 @@ aliaswait(map, ext, isopen) return isopen; } mtime = stb.st_mtime; - (void) sm_strlcpyn(buf, sizeof buf, 2, - map->map_file, ext == NULL ? "" : ext); + if (sm_strlcpyn(buf, sizeof buf, 2, + map->map_file, ext == NULL ? "" : ext) >= sizeof buf) + { + if (LogLevel > 3) + sm_syslog(LOG_INFO, NOQID, + "alias database %s%s name too long", + map->map_file, ext == NULL ? "" : ext); + message("alias database %s%s name too long", + map->map_file, ext == NULL ? "" : ext); + } + if (stat(buf, &stb) < 0 || stb.st_mtime < mtime || attimeout) { if (LogLevel > 3) @@ -913,7 +922,7 @@ forward(user, sendq, aliaslevel, e) for (pp = ForwardPath; pp != NULL; pp = ep) { int err; - char buf[MAXPATHLEN + 1]; + char buf[MAXPATHLEN]; struct stat st; ep = strchr(pp, SEPARATOR); -- cgit v1.1