summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authormrg <mrg@NetBSD.org>1997-10-07 13:07:44 +0000
committermrg <mrg@NetBSD.org>1997-10-07 13:07:44 +0000
commit08a6736e8b432ff77aa113a10c238342e4c6175f (patch)
tree2a9db8fb0f4ed94c52a0215d4cfd3267d668cad2 /libexec
parent49a7341d45018acfb59b4e7247eae64ad71a3c94 (diff)
WARNS?=1. RCS ids. did not merge very much of lite-2.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/mail.local/Makefile6
-rw-r--r--libexec/mail.local/mail.local.89
-rw-r--r--libexec/mail.local/mail.local.c46
-rw-r--r--libexec/mail.local/pathnames.h9
4 files changed, 38 insertions, 32 deletions
diff --git a/libexec/mail.local/Makefile b/libexec/mail.local/Makefile
index b9e91e92a52..c7bb8257c2f 100644
--- a/libexec/mail.local/Makefile
+++ b/libexec/mail.local/Makefile
@@ -1,9 +1,11 @@
-# $NetBSD: Makefile,v 1.4 1997/04/21 11:29:26 mrg Exp $
-# from: @(#)Makefile 5.3 (Berkeley) 1/17/91
+# $NetBSD: Makefile,v 1.5 1997/10/07 13:07:44 mrg Exp $
+# from: @(#)Makefile 8.1 (Berkeley) 7/19/93
+WARNS?= 1
PROG= mail.local
MAN= mail.local.8
BINOWN= root
BINMODE=4555
+#INSTALLFLAGS=-fschg
.include <bsd.prog.mk>
diff --git a/libexec/mail.local/mail.local.8 b/libexec/mail.local/mail.local.8
index f5d7d3e082c..325aaf3e157 100644
--- a/libexec/mail.local/mail.local.8
+++ b/libexec/mail.local/mail.local.8
@@ -1,4 +1,4 @@
-.\" $NetBSD: mail.local.8,v 1.4 1997/04/21 11:29:27 mrg Exp $
+.\" $NetBSD: mail.local.8,v 1.5 1997/10/07 13:07:45 mrg Exp $
.\"
.\" Copyright (c) 1990 The Regents of the University of California.
.\" All rights reserved.
@@ -31,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)mail.local.8 6.8 (Berkeley) 4/27/91
-.\" $Id: mail.local.8,v 1.4 1997/04/21 11:29:27 mrg Exp $
+.\" from: @(#)mail.local.8 8.2 (Berkeley) 12/11/93
.\"
-.Dd April 27, 1991
+.Dd December 11, 1993
.Dt MAIL.LOCAL 8
.Os
.Sh NAME
@@ -48,7 +47,7 @@
.Sh DESCRIPTION
.Nm Mail.local
reads the standard input up to an end-of-file and appends it to each
-.Ar user 's
+.Ar user's
.Pa mail
file.
The
diff --git a/libexec/mail.local/mail.local.c b/libexec/mail.local/mail.local.c
index 6c261ac5cc4..8d07b85d88a 100644
--- a/libexec/mail.local/mail.local.c
+++ b/libexec/mail.local/mail.local.c
@@ -1,8 +1,8 @@
-/* $NetBSD: mail.local.c,v 1.10 1997/04/21 11:29:28 mrg Exp $ */
+/* $NetBSD: mail.local.c,v 1.11 1997/10/07 13:07:45 mrg Exp $ */
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -33,31 +33,34 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1990 The Regents of the University of California.\n\
- All rights reserved.\n";
-#endif /* not lint */
-
-#ifndef lint
-/*static char sccsid[] = "from: @(#)mail.local.c 5.6 (Berkeley) 6/19/91";*/
-static char rcsid[] = "$NetBSD: mail.local.c,v 1.10 1997/04/21 11:29:28 mrg Exp $";
+__COPYRIGHT("@(#) Copyright (c) 1990, 1993, 1994\n\
+ The Regents of the University of California. All rights reserved.\n");
+#if 0
+static char sccsid[] = "@(#)mail.local.c 8.22 (Berkeley) 6/21/95";
+#else
+__RCSID("$NetBSD: mail.local.c,v 1.11 1997/10/07 13:07:45 mrg Exp $");
+#endif
#endif /* not lint */
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/socket.h>
+
#include <netinet/in.h>
-#include <syslog.h>
+
+#include <errno.h>
#include <fcntl.h>
-#include <netdb.h>
#include <pwd.h>
-#include <time.h>
-#include <unistd.h>
-#include <errno.h>
+#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <syslog.h>
+#include <time.h>
+#include <unistd.h>
+
#include "pathnames.h"
#define FATAL 1
@@ -68,18 +71,21 @@ void err __P((int, const char *, ...));
void notifybiff __P((char *));
int store __P((char *));
void usage __P((void));
+int main __P((int, char **));
+int
main(argc, argv)
int argc;
char **argv;
{
- extern int optind;
- extern char *optarg;
struct passwd *pw;
- int ch, fd, eval, lockfile=0;
+ int ch, fd, eval, lockfile = 0;
uid_t uid;
char *from;
+ /* use a reasonable umask */
+ (void) umask(0077);
+
openlog("mail.local", LOG_PERROR, LOG_MAIL);
from = NULL;
@@ -126,7 +132,7 @@ int
store(from)
char *from;
{
- FILE *fp;
+ FILE *fp = NULL; /* XXX gcc */
time_t tval;
int fd, eline;
char *tn, line[2048];
diff --git a/libexec/mail.local/pathnames.h b/libexec/mail.local/pathnames.h
index 393ab030c92..f61162a3e59 100644
--- a/libexec/mail.local/pathnames.h
+++ b/libexec/mail.local/pathnames.h
@@ -1,8 +1,8 @@
-/* $NetBSD: pathnames.h,v 1.3 1997/04/21 11:29:29 mrg Exp $ */
+/* $NetBSD: pathnames.h,v 1.4 1997/10/07 13:07:46 mrg Exp $ */
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)pathnames.h 5.3 (Berkeley) 1/17/91
- * $Id: pathnames.h,v 1.3 1997/04/21 11:29:29 mrg Exp $
+ * from: @(#)pathnames.h 8.1 (Berkeley) 6/4/93
*/
#include <paths.h>