summaryrefslogtreecommitdiffstats
path: root/lib/libfrr.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libfrr.c')
-rw-r--r--lib/libfrr.c15
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) {