SCCS-vsn: usr.sbin/sendmail/src/arpadate.c 5.3
SCCS-vsn: usr.sbin/sendmail/src/queue.c 5.4
SCCS-vsn: usr.sbin/sendmail/src/headers.c 5.4
SCCS-vsn: usr.sbin/sendmail/src/conf.c 5.3
SCCS-vsn: usr.sbin/sendmail/src/main.c 5.4
SCCS-vsn: usr.sbin/sendmail/src/daemon.c 5.4
SCCS-vsn: usr.sbin/sendmail/src/util.c 5.5
SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 5.4
SCCS-vsn: usr.sbin/sendmail/src/stats.c 5.3
SCCS-vsn: usr.sbin/sendmail/src/clock.c 5.2
SCCS-vsn: usr.sbin/sendmail/src/version.c 5.2
SCCS-vsn: usr.sbin/sendmail/src/usersmtp.c 5.3
12 files changed:
-static char SccsId[] = "@(#)arpadate.c 5.2 (Berkeley) %G%";
+static char SccsId[] = "@(#)arpadate.c 5.3 (Berkeley) %G%";
#endif not lint
# include "conf.h"
#endif not lint
# include "conf.h"
for (euptr = Foreign; euptr->f_from != NULL; euptr++)
{
for (euptr = Foreign; euptr->f_from != NULL; euptr++)
{
+ extern bool sameword();
+
if (sameword(euptr->f_from, a))
{
p = euptr->f_to;
if (sameword(euptr->f_from, a))
{
p = euptr->f_to;
-static char SccsId[] = "@(#)clock.c 5.1 (Berkeley) %G%";
+static char SccsId[] = "@(#)clock.c 5.2 (Berkeley) %G%";
#endif not lint
# include "sendmail.h"
#endif not lint
# include "sendmail.h"
-static char SccsId[] = "@(#)conf.c 5.2 (Berkeley) %G%";
+static char SccsId[] = "@(#)conf.c 5.3 (Berkeley) %G%";
#endif not lint
# include <pwd.h>
#endif not lint
# include <pwd.h>
kmem = open("/dev/kmem", 0);
if (kmem < 0)
return (-1);
kmem = open("/dev/kmem", 0);
if (kmem < 0)
return (-1);
- (void) ioctl(kmem, FIOCLEX, 0);
+ (void) ioctl(kmem, (int) FIOCLEX, (char *) 0);
nlist("/vmunix", Nl);
if (Nl[0].n_type == 0)
return (-1);
}
nlist("/vmunix", Nl);
if (Nl[0].n_type == 0)
return (-1);
}
- if (lseek(kmem, (long) Nl[X_AVENRUN].n_value, 0) < 0 ||
- read(kmem, avenrun, sizeof(avenrun)) < sizeof(avenrun))
+ if (lseek(kmem, (off_t) Nl[X_AVENRUN].n_value, 0) < 0 ||
+ read(kmem, (char *) avenrun, sizeof(avenrun)) < sizeof(avenrun))
{
/* thank you Ian */
return (-1);
{
/* thank you Ian */
return (-1);
-\f/*
-** DBMCLOSE -- close the DBM file
-**
-** This depends on the implementation of the DBM library. It
-** seems to work for all versions that I have come across.
-**
-** Parameters:
-** none.
-**
-** Returns:
-** none.
-**
-** Side Effects:
-** Closes the current DBM file; dbminit must be
-** called again to continue using the DBM routines.
-*/
-
-dbmclose()
-{
- extern int pagf, dirf; /* defined in the DBM package */
-
- (void) close(pagf);
- (void) close(dirf);
-}
# include "sendmail.h"
# include <sys/mx.h>
# include "sendmail.h"
# include <sys/mx.h>
-#ifndef DAEMON
-static char SccsId[] = "@(#)daemon.c 5.3 (Berkeley) %G% (w/o daemon mode)";
-#else
-
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <sys/wait.h>
-
-static char SccsId[] = "@(#)daemon.c 5.3 (Berkeley) %G% (with daemon mode)";
+# ifndef DAEMON
+# ifndef lint
+static char SccsId[] = "@(#)daemon.c 5.4 (Berkeley) %G% (w/o daemon mode)";
+# endif not lint
+# else
+
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <netdb.h>
+# include <sys/wait.h>
+# include <sys/time.h>
+# include <sys/resource.h>
+
+# ifndef lint
+static char SccsId[] = "@(#)daemon.c 5.4 (Berkeley) %G% (with daemon mode)";
+# endif not lint
/*
** DAEMON.C -- routines to use when running as a daemon.
/*
** DAEMON.C -- routines to use when running as a daemon.
# endif DEBUG
/* get a socket for the SMTP connection */
# endif DEBUG
/* get a socket for the SMTP connection */
- DaemonSocket = socket(AF_INET, SOCK_STREAM, 0, 0);
+ DaemonSocket = socket(AF_INET, SOCK_STREAM, 0);
if (DaemonSocket < 0)
{
/* probably another daemon already */
if (DaemonSocket < 0)
{
/* probably another daemon already */
(void) setsockopt(DaemonSocket, SOL_SOCKET, SO_DEBUG, 0, 0);
#endif DEBUG
(void) setsockopt(DaemonSocket, SOL_SOCKET, SO_DEBUG, 0, 0);
#endif DEBUG
- if (bind(DaemonSocket, &SendmailAddress, sizeof SendmailAddress, 0) < 0)
+ if (bind(DaemonSocket, &SendmailAddress, sizeof SendmailAddress) < 0)
{
syserr("getrequests: cannot bind");
(void) close(DaemonSocket);
goto severe;
}
{
syserr("getrequests: cannot bind");
(void) close(DaemonSocket);
goto severe;
}
- listen(DaemonSocket, 10);
+ if (listen(DaemonSocket, 10) < 0)
+ {
+ syserr("getrequests: cannot listen");
+ (void) close(DaemonSocket);
+ goto severe;
+ }
# ifdef DEBUG
if (tTd(15, 1))
# ifdef DEBUG
if (tTd(15, 1))
#ifdef NVMUNIX
s = socket(AF_INET, SOCK_STREAM, 0, 0);
#else NVMUNIX
#ifdef NVMUNIX
s = socket(AF_INET, SOCK_STREAM, 0, 0);
#else NVMUNIX
- s = socket(AF_INET, SOCK_STREAM, 0, 0);
+ s = socket(AF_INET, SOCK_STREAM, 0);
#endif NVMUNIX
if (s < 0)
{
#endif NVMUNIX
if (s < 0)
{
if (connect(s, &SendmailAddress, sizeof SendmailAddress, 0) < 0)
#else NVMUNIX
SendmailAddress.sin_family = AF_INET;
if (connect(s, &SendmailAddress, sizeof SendmailAddress, 0) < 0)
#else NVMUNIX
SendmailAddress.sin_family = AF_INET;
- if (connect(s, &SendmailAddress, sizeof SendmailAddress, 0) < 0)
+ if (connect(s, &SendmailAddress, sizeof SendmailAddress) < 0)
#endif NVMUNIX
{
/* failure, decide if temporary or not */
#endif NVMUNIX
{
/* failure, decide if temporary or not */
extern struct hostent *gethostbyname();
struct hostent *hp;
extern struct hostent *gethostbyname();
struct hostent *hp;
- gethostname(hostbuf, size);
+ if (gethostname(hostbuf, size) < 0)
+ {
+ (void) strcpy(hostbuf, "localhost");
+ }
hp = gethostbyname(hostbuf);
if (hp != NULL)
{
hp = gethostbyname(hostbuf);
if (hp != NULL)
{
-static char SccsId[] = "@(#)headers.c 5.3 (Berkeley) %G%";
+static char SccsId[] = "@(#)headers.c 5.4 (Berkeley) %G%";
#endif not lint
# include <errno.h>
#endif not lint
# include <errno.h>
h->h_field = newstr(fname);
h->h_value = NULL;
h->h_link = NULL;
h->h_field = newstr(fname);
h->h_value = NULL;
h->h_link = NULL;
- bcopy(mopts, h->h_mflags, sizeof mopts);
+ bcopy((char *) mopts, (char *) h->h_mflags, sizeof mopts);
*hp = h;
h->h_flags = hi->hi_flags;
if (def)
*hp = h;
h->h_flags = hi->hi_flags;
if (def)
#endif not lint
#ifndef lint
#endif not lint
#ifndef lint
-static char SccsId[] = "@(#)main.c 5.3 (Berkeley) %G%";
+static char SccsId[] = "@(#)main.c 5.4 (Berkeley) %G%";
#endif not lint
# define _DEFINE
#endif not lint
# define _DEFINE
# include <sgtty.h>
# include "sendmail.h"
# include <sgtty.h>
# include "sendmail.h"
+# ifdef lint
+char edata;
+# endif lint
+
/*
** SENDMAIL -- Post mail to a set of destinations.
**
/*
** SENDMAIL -- Post mail to a set of destinations.
**
union frz fhdr;
extern char edata;
extern char Version[];
union frz fhdr;
extern char edata;
extern char Version[];
if (freezefile == NULL)
return (FALSE);
if (freezefile == NULL)
return (FALSE);
}
/* arrange to have enough space */
}
/* arrange to have enough space */
- if (brk(fhdr.frzinfo.frzbrk) < 0)
+ if (brk(fhdr.frzinfo.frzbrk) == (caddr_t) -1)
{
syserr("Cannot break to %x", fhdr.frzinfo.frzbrk);
(void) close(f);
{
syserr("Cannot break to %x", fhdr.frzinfo.frzbrk);
(void) close(f);
fd = open("/dev/tty", 2);
if (fd >= 0)
{
fd = open("/dev/tty", 2);
if (fd >= 0)
{
- (void) ioctl(fd, TIOCNOTTY, 0);
+ (void) ioctl(fd, (int) TIOCNOTTY, (char *) 0);
errno = 0;
}
#endif TIOCNOTTY
errno = 0;
}
#endif TIOCNOTTY
# include <errno.h>
# ifndef QUEUE
# include <errno.h>
# ifndef QUEUE
-static char SccsId[] = "@(#)queue.c 5.3 (Berkeley) %G% (no queueing)";
+# ifndef lint
+static char SccsId[] = "@(#)queue.c 5.4 (Berkeley) %G% (no queueing)";
+# endif not lint
-static char SccsId[] = "@(#)queue.c 5.3 (Berkeley) %G%";
+# ifndef lint
+static char SccsId[] = "@(#)queue.c 5.4 (Berkeley) %G%";
+# endif not lint
** Sort the work directory.
*/
** Sort the work directory.
*/
- qsort(wlist, min(wn, WLSIZE), sizeof *wlist, workcmpf);
+ qsort((char *) wlist, min(wn, WLSIZE), sizeof *wlist, workcmpf);
/*
** Convert the work list into canonical form.
/*
** Convert the work list into canonical form.
# include <signal.h>
# ifndef SMTP
# include <signal.h>
# ifndef SMTP
-static char SccsId[] = "@(#)srvrsmtp.c 5.3 (Berkeley) %G% (no SMTP)";
+# ifndef lint
+static char SccsId[] = "@(#)srvrsmtp.c 5.4 (Berkeley) %G% (no SMTP)";
+# endif not lint
-static char SccsId[] = "@(#)srvrsmtp.c 5.3 (Berkeley) %G%";
+# ifndef lint
+static char SccsId[] = "@(#)srvrsmtp.c 5.4 (Berkeley) %G%";
+# endif not lint
/*
** SMTP -- run the SMTP protocol.
/*
** SMTP -- run the SMTP protocol.
-static char SccsId[] = "@(#)stats.c 5.2 (Berkeley) %G%";
+static char SccsId[] = "@(#)stats.c 5.3 (Berkeley) %G%";
#endif not lint
# include "sendmail.h"
#endif not lint
# include "sendmail.h"
{
register int fd;
struct statistics stat;
{
register int fd;
struct statistics stat;
(void) time(&Stat.stat_itime);
Stat.stat_size = sizeof Stat;
(void) time(&Stat.stat_itime);
Stat.stat_size = sizeof Stat;
bcopy((char *) &Stat, (char *) &stat, sizeof stat);
/* write out results */
bcopy((char *) &Stat, (char *) &stat, sizeof stat);
/* write out results */
- (void) lseek(fd, 0L, 0);
+ (void) lseek(fd, (off_t) 0, 0);
(void) write(fd, (char *) &stat, sizeof stat);
(void) close(fd);
}
(void) write(fd, (char *) &stat, sizeof stat);
(void) close(fd);
}
** specifies the terms and conditions for redistribution.
*/
** specifies the terms and conditions for redistribution.
*/
-#ifndef lint
-#endif not lint
# include <ctype.h>
# include <sysexits.h>
# include <ctype.h>
# include <sysexits.h>
# include "sendmail.h"
# ifndef SMTP
# include "sendmail.h"
# ifndef SMTP
-static char SccsId[] = "@(#)usersmtp.c 5.2 (Berkeley) %G% (no SMTP)";
+# ifndef lint
+static char SccsId[] = "@(#)usersmtp.c 5.3 (Berkeley) %G% (no SMTP)";
+# endif not lint
-static char SccsId[] = "@(#)usersmtp.c 5.2 (Berkeley) %G%";
+# ifndef lint
+static char SccsId[] = "@(#)usersmtp.c 5.3 (Berkeley) %G%";
+# endif not lint
-static char SccsId[] = "@(#)util.c 5.4 (Berkeley) %G%";
+static char SccsId[] = "@(#)util.c 5.5 (Berkeley) %G%";
#endif not lint
# include <stdio.h>
#endif not lint
# include <stdio.h>
register int sz;
{
register char *p;
register int sz;
{
register char *p;
+ p = malloc((unsigned) sz);
if (p == NULL)
{
syserr("Out of memory!!");
if (p == NULL)
{
syserr("Out of memory!!");
-static char SccsId[] = "@(#)version.c 5.1 (Berkeley) %G%";
+static char SccsId[] = "@(#)version.c 5.2 (Berkeley) %G%";