preliminary work to take full names
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 13 Sep 1981 07:37:14 +0000 (23:37 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 13 Sep 1981 07:37:14 +0000 (23:37 -0800)
SCCS-vsn: usr.sbin/sendmail/src/recipient.c 3.13
SCCS-vsn: usr.sbin/sendmail/src/recipient.c 3.13

usr/src/usr.sbin/sendmail/src/recipient.c

index d15c5d1..5062331 100644 (file)
@@ -3,7 +3,7 @@
 # include <sys/stat.h>
 # include "sendmail.h"
 
 # include <sys/stat.h>
 # include "sendmail.h"
 
-static char SccsId[] = "@(#)recipient.c        3.12    %G%";
+static char SccsId[] = "@(#)recipient.c        3.13    %G%";
 
 /*
 **  SENDTO -- Designate a send list.
 
 /*
 **  SENDTO -- Designate a send list.
@@ -211,8 +211,9 @@ recipient(a)
                else
                {
                        register struct passwd *pw;
                else
                {
                        register struct passwd *pw;
-                       extern struct passwd *getpwnam();
-                       pw = getpwnam(buf);
+                       extern struct passwd *finduser();
+
+                       pw = finduser(buf);
                        if (pw == NULL)
                        {
                                a->q_flags |= QBADADDR;
                        if (pw == NULL)
                        {
                                a->q_flags |= QBADADDR;
@@ -229,6 +230,31 @@ recipient(a)
        }
 }
 \f/*
        }
 }
 \f/*
+**  FINDUSER -- find the password entry for a user.
+**
+**     This looks a lot like getpwnam, except that it may want to
+**     do some fancier pattern matching in /etc/passwd.
+**
+**     Parameters:
+**             name -- the name to match against.
+**
+**     Returns:
+**             A pointer to a pw struct.
+**             NULL if name is unknown or ambiguous.
+**
+**     Side Effects:
+**             none.
+*/
+
+struct passwd *
+finduser(name)
+       char *name;
+{
+       extern struct passwd *getpwnam();
+
+       return (getpwnam(name));
+}
+\f/*
 **  WRITABLE -- predicate returning if the file is writable.
 **
 **     This routine must duplicate the algorithm in sys/fio.c.
 **  WRITABLE -- predicate returning if the file is writable.
 **
 **     This routine must duplicate the algorithm in sys/fio.c.