summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorniklas <niklas@openbsd.org>2000-05-03 13:47:27 +0000
committerniklas <niklas@openbsd.org>2000-05-03 13:47:27 +0000
commitc3c2e2ac92f9eba7ece35a10f613bcf456dd47f7 (patch)
tree38c6aa70b6c16a2062b0d63c32965e12866435e6
parentMerge with EOM 1.28 (diff)
downloadwireguard-openbsd-c3c2e2ac92f9eba7ece35a10f613bcf456dd47f7.tar.xz
wireguard-openbsd-c3c2e2ac92f9eba7ece35a10f613bcf456dd47f7.zip
Merge with EOM 1.51
author: ho style fix author: ho Create report files with umask 077
-rw-r--r--sbin/isakmpd/isakmpd.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sbin/isakmpd/isakmpd.c b/sbin/isakmpd/isakmpd.c
index f01fa29d522..5abe7b66bc8 100644
--- a/sbin/isakmpd/isakmpd.c
+++ b/sbin/isakmpd/isakmpd.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: isakmpd.c,v 1.22 2000/05/02 14:36:30 niklas Exp $ */
-/* $EOM: isakmpd.c,v 1.49 2000/04/27 17:39:17 niklas Exp $ */
+/* $OpenBSD: isakmpd.c,v 1.23 2000/05/03 13:47:27 niklas Exp $ */
+/* $EOM: isakmpd.c,v 1.51 2000/05/03 13:22:20 ho Exp $ */
/*
* Copyright (c) 1998, 1999, 2000 Niklas Hallqvist. All rights reserved.
@@ -37,6 +37,8 @@
#include <errno.h>
#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -244,8 +246,12 @@ sighup (int sig)
static void
report (void)
{
- FILE *report = fopen (report_file, "w");
- FILE *old;
+ FILE *report, *old;
+ mode_t old_umask;
+
+ old_umask = umask (S_IRWXG | S_IRWXO);
+ report = fopen (report_file, "w");
+ umask (old_umask);
if (!report)
{