diff options
author | gdt <gdt> | 2003-12-22 20:15:53 +0000 |
---|---|---|
committer | gdt <gdt> | 2003-12-22 20:15:53 +0000 |
commit | 29d3f53fdb17548a020683f1cc18cb4b78a8116c (patch) | |
tree | bf1db2b34a5b03486d182ee6afc8c8295c60d715 /bgpd/bgp_dump.c | |
parent | a2be3c0db267692f66def274bac2afdf1596e7fb (diff) | |
download | quagga-29d3f53fdb17548a020683f1cc18cb4b78a8116c.tar.bz2 quagga-29d3f53fdb17548a020683f1cc18cb4b78a8116c.tar.xz |
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/bgp_dump.c')
-rw-r--r-- | bgpd/bgp_dump.c | 8 |
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; } |