[pim] pim commands added to vtysh
diff --git a/pimd/pim_main.c b/pimd/pim_main.c
index 1206b55..3cf1869 100644
--- a/pimd/pim_main.c
+++ b/pimd/pim_main.c
@@ -23,6 +23,7 @@
#include <zebra.h>
#include "log.h"
+#include "privs.h"
#include "version.h"
#include <getopt.h>
#include "command.h"
@@ -61,6 +62,29 @@
{ 0 }
};
+/* pimd privileges */
+zebra_capabilities_t _caps_p [] =
+{
+ ZCAP_NET_ADMIN,
+ ZCAP_SYS_ADMIN,
+ ZCAP_NET_RAW,
+};
+
+/* pimd privileges to run with */
+struct zebra_privs_t pimd_privs =
+{
+#if defined(QUAGGA_USER) && defined(QUAGGA_GROUP)
+ .user = QUAGGA_USER,
+ .group = QUAGGA_GROUP,
+#endif
+#ifdef VTY_GROUP
+ .vty_group = VTY_GROUP,
+#endif
+ .caps_p = _caps_p,
+ .cap_num_p = sizeof(_caps_p)/sizeof(_caps_p[0]),
+ .cap_num_i = 0
+};
+
char* progname;
const char *pid_file = PATH_PIMD_PID;
@@ -170,6 +194,7 @@
/*
* Initializations
*/
+ zprivs_init (&pimd_privs);
pim_signals_init();
cmd_init(1);
vty_init(master);