SCCS-vsn: usr.sbin/sendmail/src/alias.c 3.18
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 3.31
SCCS-vsn: usr.sbin/sendmail/src/recipient.c 3.7
+# include <sys/types.h>
+# include <sys/stat.h>
# include "sendmail.h"
# ifdef DBM
# include "sendmail.h"
# ifdef DBM
-static char SccsId[] = "@(#)alias.c 3.17 %G% (with DBM)";
+static char SccsId[] = "@(#)alias.c 3.18 %G% (with DBM)";
-static char SccsId[] = "@(#)alias.c 3.17 %G% (without DBM)";
+static char SccsId[] = "@(#)alias.c 3.18 %G% (without DBM)";
char buf[60];
register FILE *fp;
register char *p;
char buf[60];
register FILE *fp;
register char *p;
/* good address -- look for .forward file in home */
define('z', user->q_home);
(void) expand("$z/.forward", buf, &buf[sizeof buf - 1]);
/* good address -- look for .forward file in home */
define('z', user->q_home);
(void) expand("$z/.forward", buf, &buf[sizeof buf - 1]);
- if (access(buf, 4) < 0)
+ if (stat(buf, &stbuf) < 0 || stbuf.st_uid != user->q_uid ||
+ !bitset(S_IREAD, stbuf.st_mode))
return;
/* we do have an address to forward to -- do it */
return;
/* we do have an address to forward to -- do it */
# include <pwd.h>
# include "sendmail.h"
# include <pwd.h>
# include "sendmail.h"
-static char SccsId[] = "@(#)recipient.c 3.6 %G%";
+static char SccsId[] = "@(#)recipient.c 3.7 %G%";
/*
** SENDTO -- Designate a send list.
/*
** SENDTO -- Designate a send list.
else
{
a->q_home = newstr(pw->pw_dir);
else
{
a->q_home = newstr(pw->pw_dir);
if (strcmp(buf, a->q_user) == 0)
forward(a);
}
if (strcmp(buf, a->q_user) == 0)
forward(a);
}
/*
** SENDMAIL.H -- Global definitions for sendmail.
**
/*
** SENDMAIL.H -- Global definitions for sendmail.
**
-** @(#)sendmail.h 3.30 %G%
+** @(#)sendmail.h 3.31 %G%
short q_mailer; /* mailer to use */
short q_rmailer; /* real mailer (before mapping) */
u_short q_flags; /* status flags, see below */
short q_mailer; /* mailer to use */
short q_rmailer; /* real mailer (before mapping) */
u_short q_flags; /* status flags, see below */
+ short q_uid; /* user-id of receiver (if known) */
char *q_home; /* home dir (local mailer only) */
struct address *q_next; /* chain */
};
char *q_home; /* home dir (local mailer only) */
struct address *q_next; /* chain */
};