summaryrefslogtreecommitdiff
path: root/gnu/usr.sbin/sendmail/mailstats
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-06-03 17:25:48 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-06-03 17:25:48 +0000
commit516364eba6479ea4a301d76d0a0d0f5304ed990a (patch)
tree1223cc7516ed02f41ff733ffa28e673f664740f3 /gnu/usr.sbin/sendmail/mailstats
parent1708fb9909a4490bf6d68894d8c5862f8c78e121 (diff)
Update to sendmail-8.12.4
Diffstat (limited to 'gnu/usr.sbin/sendmail/mailstats')
-rw-r--r--gnu/usr.sbin/sendmail/mailstats/mailstats.89
-rw-r--r--gnu/usr.sbin/sendmail/mailstats/mailstats.c31
2 files changed, 23 insertions, 17 deletions
diff --git a/gnu/usr.sbin/sendmail/mailstats/mailstats.8 b/gnu/usr.sbin/sendmail/mailstats/mailstats.8
index 87690db332d..199cd510b50 100644
--- a/gnu/usr.sbin/sendmail/mailstats/mailstats.8
+++ b/gnu/usr.sbin/sendmail/mailstats/mailstats.8
@@ -6,9 +6,9 @@
.\" the sendmail distribution.
.\"
.\"
-.\" $Sendmail: mailstats.8,v 8.28 2002/03/19 00:23:23 gshapiro Exp $
+.\" $Sendmail: mailstats.8,v 8.30 2002/04/12 00:42:33 ca Exp $
.\"
-.Dd April 18, 2001
+.Dd April 12, 2002
.Dt MAILSTATS 1
.Os
.Sh NAME
@@ -16,6 +16,7 @@
.Nd display mail statistics
.Sh SYNOPSIS
.Nm mailstats
+.Op Fl c
.Op Fl o
.Op Fl p
.Op Fl P
@@ -68,6 +69,10 @@ The options are as follows:
Read the specified file instead of the default
.Nm sendmail
configuration file.
+.It Fl c
+Try to use submit.cf instead of the default
+.Nm sendmail
+configuration file.
.It Fl f
Read the specified statistics file instead of the statistics file
specified in the
diff --git a/gnu/usr.sbin/sendmail/mailstats/mailstats.c b/gnu/usr.sbin/sendmail/mailstats/mailstats.c
index 3d07d02eab0..05ee3a3f7b5 100644
--- a/gnu/usr.sbin/sendmail/mailstats/mailstats.c
+++ b/gnu/usr.sbin/sendmail/mailstats/mailstats.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -20,7 +20,7 @@ SM_IDSTR(copyright,
Copyright (c) 1988, 1993\n\
The Regents of the University of California. All rights reserved.\n")
-SM_IDSTR(id, "@(#)$Sendmail: mailstats.c,v 8.95 2001/12/30 04:59:40 gshapiro Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: mailstats.c,v 8.98 2002/05/24 23:10:15 gshapiro Exp $")
#include <unistd.h>
#include <stddef.h>
@@ -64,7 +64,7 @@ main(argc, argv)
#endif /* _FFR_QUARANTINE */
time_t now;
char mtable[MAXMAILERS][MNAMELEN + 1];
- char sfilebuf[MAXLINE];
+ char sfilebuf[MAXPATHLEN];
char buf[MAXLINE];
struct statistics stats;
extern char *ctime();
@@ -108,7 +108,7 @@ main(argc, argv)
default:
usage:
(void) sm_io_fputs(smioerr, SM_TIME_DEFAULT,
- "usage: mailstats [-C cffile] [-P] [-f stfile] [-o] [-p]\n");
+ "usage: mailstats [-C cffile] [-c] [-P] [-f stfile] [-o] [-p]\n");
exit(EX_USAGE);
}
}
@@ -139,6 +139,15 @@ main(argc, argv)
char *s;
register char *m;
+ b = strchr(buf, '#');
+ if (b == NULL)
+ b = strchr(buf, '\n');
+ if (b == NULL)
+ b = &buf[strlen(buf)];
+ while (isascii(*--b) && isspace(*b))
+ continue;
+ *++b = '\0';
+
b = buf;
switch (*b++)
{
@@ -171,14 +180,6 @@ main(argc, argv)
b);
exit(EX_CONFIG);
}
- b = strchr(sfilebuf, '#');
- if (b == NULL)
- b = strchr(sfilebuf, '\n');
- if (b == NULL)
- b = &sfilebuf[strlen(sfilebuf)];
- while (isascii(*--b) && isspace(*b))
- continue;
- *++b = '\0';
if (sfile == NULL)
sfile = sfilebuf;
@@ -215,10 +216,10 @@ main(argc, argv)
{
(void) sm_io_fprintf(smioerr, SM_TIME_DEFAULT,
"mailstats: no statistics file located\n");
- exit (EX_OSFILE);
+ exit(EX_OSFILE);
}
- fd = open(sfile, O_RDONLY);
+ fd = open(sfile, O_RDONLY, 0600);
if ((fd < 0) || (i = read(fd, &stats, sizeof stats)) < 0)
{
save_errno = errno;
@@ -350,7 +351,7 @@ main(argc, argv)
(void) close(fd);
if (trunc)
{
- fd = open(sfile, O_RDWR | O_TRUNC);
+ fd = open(sfile, O_RDWR | O_TRUNC, 0600);
if (fd >= 0)
(void) close(fd);
}