summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-09-21 08:11:04 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-09-21 08:11:04 +0000
commita2f8ead9c969c7855e6eddc7b3e96b07c8d8dcbd (patch)
treea93d142a062918f0f57260080608d1946b7ce38f /usr.bin
parentb50788c60e3cd9d17ebd71879bcf38b1d50b40bd (diff)
gen ktrace.out with restrictive umask; from joerg@freebsd.org
Diffstat (limited to 'usr.bin')
-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) {