summaryrefslogtreecommitdiff
path: root/lib/vty.c
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 /lib/vty.c
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 'lib/vty.c')
-rw-r--r--lib/vty.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/vty.c b/lib/vty.c
index edfd99dd..8ba99708 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2185,6 +2185,14 @@ vty_use_backup_config (char *fullpath)
close (sav);
close (tmp);
+ if (chmod(fullpath_tmp, CONFIGFILE_MASK) != 0)
+ {
+ free (fullpath_sav);
+ free (fullpath_tmp);
+ unlink (fullpath_tmp);
+ return NULL;
+ }
+
if (link (fullpath_tmp, fullpath) == 0)
ret = fopen (fullpath, "r");