SCCS-vsn: usr.sbin/sendmail/src/recipient.c 8.22
-static char sccsid[] = "@(#)recipient.c 8.21 (Berkeley) %G%";
+static char sccsid[] = "@(#)recipient.c 8.22 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
a->q_flags |= QBADADDR;
usrerr("550 Cannot mail directly to files");
}
a->q_flags |= QBADADDR;
usrerr("550 Cannot mail directly to files");
}
- else if ((stat(buf, &stb) >= 0) ? (!writable(&stb)) :
+ else if ((stat(buf, &stb) >= 0) ? (!writable(buf, &stb)) :
(*p = '\0', safefile(buf, RealUid, RealGid, NULL, TRUE, S_IWRITE|S_IEXEC) != 0))
{
a->q_flags |= QBADADDR;
(*p = '\0', safefile(buf, RealUid, RealGid, NULL, TRUE, S_IWRITE|S_IEXEC) != 0))
{
a->q_flags |= QBADADDR;
if (!bitset(QDONTSEND|QNOTREMOTE|QVERIFIED, a->q_flags))
{
extern int udbexpand();
if (!bitset(QDONTSEND|QNOTREMOTE|QVERIFIED, a->q_flags))
{
extern int udbexpand();
if (udbexpand(a, sendq, e) == EX_TEMPFAIL)
{
if (udbexpand(a, sendq, e) == EX_TEMPFAIL)
{
+writable(filename, s)
+ char *filename;
register struct stat *s;
{
uid_t euid;
gid_t egid;
int bits;
register struct stat *s;
{
uid_t euid;
gid_t egid;
int bits;
+ if (tTd(29, 5))
+ printf("writable(%s) mode=%o\n", filename, s->st_mode);
if (bitset(0111, s->st_mode))
return (FALSE);
euid = RealUid;
if (bitset(0111, s->st_mode))
return (FALSE);
euid = RealUid;
+ if (tTd(29, 5))
+ printf("\teu/gid=%d/%d, st_u/gid=%d/%d\n",
+ euid, egid, s->st_uid, s->st_gid);
+
if (euid == 0)
return (TRUE);
bits = S_IWRITE;
if (euid == 0)
return (TRUE);
bits = S_IWRITE;