From: Eric Allman Date: Sun, 13 Sep 1981 13:54:44 +0000 (-0800) Subject: don't match on one-word gecos entries to avoid stealing mail X-Git-Tag: BSD-4_1_snap-Snapshot-Development~849 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/c86ca76c3016c6b5b86cc75afa0ff3d50597525a don't match on one-word gecos entries to avoid stealing mail SCCS-vsn: usr.sbin/sendmail/src/recipient.c 3.16 --- diff --git a/usr/src/usr.sbin/sendmail/src/recipient.c b/usr/src/usr.sbin/sendmail/src/recipient.c index 62560ce930..acece92306 100644 --- a/usr/src/usr.sbin/sendmail/src/recipient.c +++ b/usr/src/usr.sbin/sendmail/src/recipient.c @@ -3,7 +3,7 @@ # include # include "sendmail.h" -static char SccsId[] = "@(#)recipient.c 3.15 %G%"; +static char SccsId[] = "@(#)recipient.c 3.16 %G%"; /* ** SENDTO -- Designate a send list. @@ -264,16 +264,22 @@ finduser(name) char buf[MAXNAME]; register char *p; extern bool sameword(); + bool gotaspace; if (strcmp(pw->pw_name, name) == 0) return (pw); buildfname(pw->pw_gecos, pw->pw_name, buf); + gotaspace = FALSE; for (p = buf; (p = index(p, ' ')) != NULL; ) + { *p++ = SPACESUB & 0177; - if (sameword(buf, name)) + gotaspace = TRUE; + } + if (gotaspace && sameword(buf, name)) { if (Verbose) - message(Arpa_Info, "sending to login name %s", pw->pw_name); + message(Arpa_Info, "sending to login name %s", + pw->pw_name); return (pw); } }