summaryrefslogtreecommitdiff
path: root/lib/command.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/command.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/command.c')
-rw-r--r--lib/command.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/command.c b/lib/command.c
index 8c60fc4f..43a0bb3f 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2552,6 +2552,14 @@ DEFUN (config_write_file,
free (config_file_sav);
free (config_file_tmp);
+
+ if (chmod (config_file, CONFIGFILE_MASK) != 0)
+ {
+ vty_out (vty, "Can't chmod configuration file %s: %s (%d).%s",
+ config_file, strerror(errno), errno, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
vty_out (vty, "Configuration saved to %s%s", config_file,
VTY_NEWLINE);
return CMD_SUCCESS;