diff options
author | Leonard Herve <leonard.herve@yahoo.fr> | 2009-08-11 15:45:26 -0300 |
---|---|---|
committer | Everton Marques <everton.marques@gmail.com> | 2009-10-02 10:44:30 -0300 |
commit | 40b0f20733365209141491e3c45ebaf63979d835 (patch) | |
tree | f8eee75eb1e43e94acf826699d3e8bc51672a9d1 /pimd/pim_main.c | |
parent | f1bad8260c8c9942057c569b2a1a687a92b54862 (diff) | |
download | quagga-40b0f20733365209141491e3c45ebaf63979d835.tar.bz2 quagga-40b0f20733365209141491e3c45ebaf63979d835.tar.xz |
[pim] pim commands added to vtysh
Diffstat (limited to 'pimd/pim_main.c')
-rw-r--r-- | pimd/pim_main.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pimd/pim_main.c b/pimd/pim_main.c index 1206b551..3cf1869c 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 @@ struct option longopts[] = { { 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 @@ int main(int argc, char** argv, char** envp) { /* * Initializations */ + zprivs_init (&pimd_privs); pim_signals_init(); cmd_init(1); vty_init(master); |