SCCS-vsn: usr.sbin/sendmail/src/recipient.c 8.28
SCCS-vsn: usr.sbin/sendmail/src/err.c 8.16
-static char sccsid[] = "@(#)err.c 8.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)err.c 8.16 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
extern char *SmtpPhase;
# endif /* SMTP */
extern char *SmtpPhase;
# endif /* SMTP */
-# ifdef DAEMON
-# ifdef ETIMEDOUT
/*
** Handle special network error codes.
**
/*
** Handle special network error codes.
**
+# if defined(DAEMON) && defined(ETIMEDOUT)
case ETIMEDOUT:
case ECONNRESET:
(void) strcpy(buf, sys_errlist[errno]);
case ETIMEDOUT:
case ECONNRESET:
(void) strcpy(buf, sys_errlist[errno]);
break;
(void) sprintf(buf, "Connection refused by %s", CurHostName);
return (buf);
break;
(void) sprintf(buf, "Connection refused by %s", CurHostName);
return (buf);
case EOPENTIMEOUT:
return "Timeout on file open";
case EOPENTIMEOUT:
return "Timeout on file open";
case NO_DATA + E_DNSBASE:
return ("Name server: no data known for name");
# endif
case NO_DATA + E_DNSBASE:
return ("Name server: no data known for name");
# endif
+
+ case EPERM:
+ /* SunOS gives "Not owner" -- this is the POSIX message */
+ return "Operation not permitted";
if (errno > 0 && errno < sys_nerr)
return (sys_errlist[errno]);
if (errno > 0 && errno < sys_nerr)
return (sys_errlist[errno]);
-static char sccsid[] = "@(#)recipient.c 8.27 (Berkeley) %G%";
+static char sccsid[] = "@(#)recipient.c 8.28 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
/* file does not exist -- see if directory is safe */
p = strrchr(filename, '/');
if (p == NULL)
/* file does not exist -- see if directory is safe */
p = strrchr(filename, '/');
if (p == NULL)
- return FALSE;
- *p = '\0';
- if (safefile(filename, RealUid, RealGid, RealUserName,
- SFF_MUSTOWN, S_IWRITE|S_IEXEC) != 0)
+ *p = '\0';
+ errno = safefile(filename, RealUid, RealGid, RealUserName,
+ SFF_MUSTOWN, S_IWRITE|S_IEXEC);
{
if (tTd(29, 5))
printf("failed (mode %o: x bits)\n", stb.st_mode);
{
if (tTd(29, 5))
printf("failed (mode %o: x bits)\n", stb.st_mode);
printf("\teu/gid=%d/%d, st_u/gid=%d/%d\n",
euid, egid, stb.st_uid, stb.st_gid);
printf("\teu/gid=%d/%d, st_u/gid=%d/%d\n",
euid, egid, stb.st_uid, stb.st_gid);
- return safefile(filename, euid, egid, uname, flags, S_IWRITE) == 0;
+ errno = safefile(filename, euid, egid, uname, flags, S_IWRITE);
+ return errno == 0;
}
\f/*
** INCLUDE -- handle :include: specification.
}
\f/*
** INCLUDE -- handle :include: specification.