summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/ktrace/ktrace.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/ktrace/ktrace.c b/usr.bin/ktrace/ktrace.c
index 6ed793f4e58..6a4436341a3 100644
--- a/usr.bin/ktrace/ktrace.c
+++ b/usr.bin/ktrace/ktrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ktrace.c,v 1.2 1996/06/26 05:34:46 deraadt Exp $ */
+/* $OpenBSD: ktrace.c,v 1.3 1996/09/21 08:11:03 deraadt Exp $ */
/* $NetBSD: ktrace.c,v 1.4 1995/08/31 23:01:44 jtc Exp $ */
/*-
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)ktrace.c 8.2 (Berkeley) 4/28/95";
#endif
-static char *rcsid = "$OpenBSD: ktrace.c,v 1.2 1996/06/26 05:34:46 deraadt Exp $";
+static char *rcsid = "$OpenBSD: ktrace.c,v 1.3 1996/09/21 08:11:03 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -71,6 +71,7 @@ main(argc, argv)
enum { NOTSET, CLEAR, CLEARALL } clear;
int append, ch, fd, inherit, ops, pid, pidset, trpoints;
char *tracefile;
+ mode_t omask;
clear = NOTSET;
append = ops = pidset = inherit = 0;
@@ -138,9 +139,11 @@ main(argc, argv)
exit(0);
}
+ omask = umask(S_IRWXG|S_IRWXO);
if ((fd = open(tracefile, O_CREAT | O_WRONLY | (append ? 0 : O_TRUNC),
DEFFILEMODE)) < 0)
err(1, tracefile);
+ (void)umask(omask);
(void)close(fd);
if (*argv) {