diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2017-08-03 06:02:45 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2017-08-09 10:55:03 +0200 |
commit | b8c1fde3cb210137549d81e2971120a30d6b6bf2 (patch) | |
tree | 4ba898dcab947b672debd2de2e1573c904cce244 /lib/libfrr.c | |
parent | lib: close stdin/out/err in non-terminal case (diff) | |
download | frr-b8c1fde3cb210137549d81e2971120a30d6b6bf2.tar.xz frr-b8c1fde3cb210137549d81e2971120a30d6b6bf2.zip |
lib: don't mkdir state paths in watchfrr
watchfrr doesn't know if there will be -u/-g options on the individual
daemons, so it doesn't know what the appropriate ownership is.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/libfrr.c')
-rw-r--r-- | lib/libfrr.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/libfrr.c b/lib/libfrr.c index aa21a143b..31d93009f 100644 --- a/lib/libfrr.c +++ b/lib/libfrr.c @@ -399,12 +399,15 @@ struct thread_master *frr_init(void) zlog_set_level(ZLOG_DEST_SYSLOG, zlog_default->default_lvl); #endif - if (!di->pid_file || !di->vty_path) - frr_mkdir(frr_vtydir, false); - if (di->pid_file) - frr_mkdir(di->pid_file, true); - if (di->vty_path) - frr_mkdir(di->vty_path, true); + /* don't mkdir these as root... */ + if (!(di->flags & FRR_NO_PRIVSEP)) { + if (!di->pid_file || !di->vty_path) + frr_mkdir(frr_vtydir, false); + if (di->pid_file) + frr_mkdir(di->pid_file, true); + if (di->vty_path) + frr_mkdir(di->vty_path, true); + } frrmod_init(di->module); while (modules) { |