From aa593d5e2638566ead1e69381e60639550991ff2 Mon Sep 17 00:00:00 2001 From: gdt Date: Mon, 22 Dec 2003 20:15:53 +0000 Subject: 2003-12-22 Christian Hammers * configure.ac (and everywhere a regular file is opened for writing): use file permissions from configure rather than compiled-in umask. --- bgpd/bgp_dump.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'bgpd/bgp_dump.c') diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c index 7dc64c6a..9690fb56 100644 --- a/bgpd/bgp_dump.c +++ b/bgpd/bgp_dump.c @@ -95,6 +95,7 @@ bgp_dump_open_file (struct bgp_dump *bgp_dump) struct tm *tm; char fullpath[MAXPATHLEN]; char realpath[MAXPATHLEN]; + mode_t oldumask; time (&clock); tm = localtime (&clock); @@ -117,10 +118,15 @@ bgp_dump_open_file (struct bgp_dump *bgp_dump) fclose (bgp_dump->fp); + oldumask = umask(0777 & ~LOGFILE_MASK); bgp_dump->fp = fopen (realpath, "w"); if (bgp_dump->fp == NULL) - return NULL; + { + umask(oldumask); + return NULL; + } + umask(oldumask); return bgp_dump->fp; } -- cgit v1.2.1