summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
83ed03c)
unset HOSTALIASES for daemon or queue mode
SCCS-vsn: usr.sbin/sendmail/src/main.c 5.23
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 5.22 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c 5.23 (Berkeley) %G%";
#endif /* not lint */
#define _DEFINE
#endif /* not lint */
#define _DEFINE
switch (p[2])
{
case MD_DAEMON:
switch (p[2])
{
case MD_DAEMON:
+# ifdef DAEMON
+ if (getuid() != 0) {
+ usrerr("Permission denied");
+ exit (EX_USAGE);
+ }
+ (void) unsetenv("HOSTALIASES");
+# else
usrerr("Daemon mode not implemented");
ExitStat = EX_USAGE;
break;
usrerr("Daemon mode not implemented");
ExitStat = EX_USAGE;
break;
case 'q': /* run queue files at intervals */
# ifdef QUEUE
case 'q': /* run queue files at intervals */
# ifdef QUEUE
+ if (getuid() != 0) {
+ usrerr("Permission denied");
+ exit (EX_USAGE);
+ }
+ (void) unsetenv("HOSTALIASES");
queuemode = TRUE;
QueueIntvl = convtime(&p[2]);
# else QUEUE
queuemode = TRUE;
QueueIntvl = convtime(&p[2]);
# else QUEUE