summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorgdt <gdt>2003-12-22 20:15:53 +0000
committergdt <gdt>2003-12-22 20:15:53 +0000
commitaa593d5e2638566ead1e69381e60639550991ff2 (patch)
treec865f642c1029fa47b8fc6cc86302468b9b2aef4 /bgpd
parent47ce02a8f12134a6ba515fbf1d2b9276e39d4c06 (diff)
2003-12-22 Christian Hammers <ch@lathspell.de>
* configure.ac (and everywhere a regular file is opened for writing): use file permissions from configure rather than compiled-in umask.
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_dump.c8
1 files changed, 7 insertions, 1 deletions
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;
}