X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/95f51977ddc18faa2e212f30c00a39540b39f325..ca67e7b465996afb3821d6a075c4dc6a7f0f5d52:/usr/src/usr.lib/sendmail/src/main.c diff --git a/usr/src/usr.lib/sendmail/src/main.c b/usr/src/usr.lib/sendmail/src/main.c index b04dfe3359..bc98bbbe1d 100644 --- a/usr/src/usr.lib/sendmail/src/main.c +++ b/usr/src/usr.lib/sendmail/src/main.c @@ -1,27 +1,38 @@ /* -** Sendmail -** Copyright (c) 1983 Eric P. Allman -** Berkeley, California -** -** Copyright (c) 1983 Regents of the University of California. -** All rights reserved. The Berkeley software License Agreement -** specifies the terms and conditions for redistribution. -*/ + * Copyright (c) 1983 Eric P. Allman + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ #ifndef lint char copyright[] = -"@(#) Copyright (c) 1980 Regents of the University of California.\n\ +"@(#) Copyright (c) 1988 Regents of the University of California.\n\ All rights reserved.\n"; -#endif not lint +#endif /* not lint */ #ifndef lint -static char SccsId[] = "@(#)main.c 5.11 (Berkeley) 1/30/86"; -#endif not lint +static char sccsid[] = "@(#)main.c 5.18 (Berkeley) 6/30/88"; +#endif /* not lint */ -# define _DEFINE -# include -# include -# include "sendmail.h" +#define _DEFINE + +#include +#include +#include "sendmail.h" +#include +#include # ifdef lint char edata, end; @@ -59,9 +70,6 @@ char edata, end; */ - - - int NextMailer; /* "free" index into Mailer struct */ char *FullName; /* sender's full name */ ENVELOPE BlankEnvelope; /* a "blank" envelope */ @@ -87,11 +95,6 @@ ERROR %%%% Cannot have daemon mode without SMTP %%%% ERROR #endif SMTP #endif DAEMON - - - - - main(argc, argv, envp) int argc; char **argv; @@ -132,10 +135,17 @@ main(argc, argv, envp) } reenter = TRUE; + /* Enforce use of local time */ + unsetenv("TZ"); + /* ** Be sure we have enough file descriptors. + ** But also be sure that 0, 1, & 2 are open. */ + i = open("/dev/null", 2); + while (i >= 0 && i < 2) + i = dup(i); for (i = 3; i < 50; i++) (void) close(i); errno = 0; @@ -225,9 +235,7 @@ main(argc, argv, envp) OldUmask = umask(0); OpMode = MD_DELIVER; MotherPid = getpid(); -# ifndef V6 FullName = getenv("NAME"); -# endif V6 # ifdef LOG openlog("sendmail", LOG_PID, LOG_MAIL); @@ -318,13 +326,14 @@ main(argc, argv, envp) case 'C': /* select configuration file (already done) */ break; -# ifdef DEBUG +#ifdef DEBUG case 'd': /* debugging -- redo in case frozen */ tTsetup(tTdvect, sizeof tTdvect, "0-99.1"); tTflag(&p[2]); setbuf(stdout, (char *) NULL); + _res.options |= RES_DEBUG; break; -# endif DEBUG +#endif case 'f': /* from address */ case 'r': /* obsolete -f flag */ @@ -917,7 +926,7 @@ thaw(freezefile) { int f; union frz fhdr; - extern char edata; + extern char edata, end; extern char Version[]; extern caddr_t brk();