summaryrefslogtreecommitdiffstats
path: root/vtysh/vtysh.c
diff options
context:
space:
mode:
authorJafar Al-Gharaibeh <jafar@atcorp.com>2017-05-23 20:23:04 +0200
committerJafar Al-Gharaibeh <jafar@atcorp.com>2017-05-26 19:53:08 +0200
commit9e8df9882c7c3fcc80aba2923cafd8d3188d83ad (patch)
tree8c8b14a8eb91dc1dd6fab4b3aa7466b1299dd412 /vtysh/vtysh.c
parentMerge pull request #611 from LabNConsulting/working/3.0/patch-set/deprecateEncap (diff)
downloadfrr-9e8df9882c7c3fcc80aba2923cafd8d3188d83ad.tar.xz
frr-9e8df9882c7c3fcc80aba2923cafd8d3188d83ad.zip
vtysh: fix a compile error when user/group are disabled
If FRR is configured explicilty with --disable-user and --disable-group, FRR_USER and FRR_GROUP will not be defined and can be safely skipped in vtysh. Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
Diffstat (limited to '')
-rw-r--r--vtysh/vtysh.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 24ac9675e..17b95707d 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -2488,6 +2488,7 @@ vtysh_write_config_integrated(void)
err++;
}
+#ifdef FRR_USER
pwentry = getpwnam (FRR_USER);
if (pwentry)
uid = pwentry->pw_uid;
@@ -2496,7 +2497,8 @@ vtysh_write_config_integrated(void)
printf ("%% Warning: could not look up user \"%s\"\n", FRR_USER);
err++;
}
-
+#endif
+#ifdef FRR_GROUP
grentry = getgrnam (FRR_GROUP);
if (grentry)
gid = grentry->gr_gid;
@@ -2505,6 +2507,7 @@ vtysh_write_config_integrated(void)
printf ("%% Warning: could not look up group \"%s\"\n", FRR_GROUP);
err++;
}
+#endif
if (!fstat (fd, &st))
{